I don't feel 50 Forums

Go Back   I don't feel 50 Forums > COMPUTERS > Web Design and Graphics Room.

Web Design and Graphics Room. Thread, is there a Java script expert here ???

hi all, i am of an age where i will never ever master the art of understanding Java Script, but ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 2nd-August-2007, 10:17 PM
timmy toad timmy toad is offline
 
Join Date: Sep 2002
Location: flitwick, beds, UK
Posts: 198
Default is there a Java script expert here ???

hi all, i am of an age where i will never ever master the art of understanding Java Script, but i can, i do believe, I NEARLY have enough of a clue to use a ready made Java Script routine,

I have been browsing the website of my local Football club, Luton Town !!!! (The Hatters), my eye was immediately attracted to a little toolbar that allows you to change the Text size on the web page (without the need to go to the View/Text size menu in the toolbar).

I quickly found the relevant piece of HTML code that displays the toolbar on the Page, but apart from that i dont remember how to implement the JS on a Web Page of my own.

Anybody fancy trying to show me how ?.

The Web Site

http://www.lutontown.premiumtv.co.uk...,10372,00.html

The script

www.timparsons.net/javascript.txt

the javascript file saved as a notepad file doesnt display as i thought it would, so i suggest you View Source when looking at this file, ta.
__________________
Tim

Acer Aspire Lap Top/AMD 3000 +Sempron/1.5 gig ram/160 gig HD/Win XP SP2/NTL Broadband/Avira Anti Virus
Reply With Quote
  #2  
Old 6th-August-2007, 03:12 AM
Skyrunner's Avatar
Skyrunner Skyrunner is offline
 
Join Date: Sep 2002
Location: The Surrey Hills
Posts: 1,202
Default

Hi Tim....

Firstly congratulations on locating the relevant bit of code from that huge complicated site! (Took me ages!)

I'm not terribly well up on Javascript (yet!) and there's masses on that site, I'm not even going to attempt to sort it out... But usually, the main javascript code is in the head part of the source code, or in an external file which the page links to. (In the same manner it would link to an external CSS style sheet.)

Firstly, you need to tell the browser to read the code as javascript.

Code:
<script type="text/javascript" language="javascript">
Then comes the script, and it closes with

Code:
</script>
Tells the browser it's the end of it.


Okay, I've had a poke about on the internet, and found a bit of script that seems to do what you want. It works in my versions of Firefox and IE, but I can't guarantee it works in all of them, and of course, no javascript works if the user has it turned off in their browser!

All you need are a couple of little graphics to indicate text size up and text size down. Plus the script which goes in the head of the code. This script is tied to the

tag, and works best if you specify your font size in pixels in your stylesheet.

I've made up a little page for you to see, look at the source to see the code, and where the javascript is. Note the event trigger in the code where the graphics are placed on the page.

Try to reproduce this page yourself, (you can pinch my little graphics to practice with) and see if you can get it to work.

http://www.clamgraphics.co.uk/webstore-11/page4tim.html
Reply With Quote
  #3  
Old 6th-August-2007, 07:04 PM
timmy toad timmy toad is offline
 
Join Date: Sep 2002
Location: flitwick, beds, UK
Posts: 198
Default

Gee Wiz skyrunner that is absolutely prefect, i am well proud of you, thanks a million for making it look so dammed easy. THANKS.

as for finding the relevant JS code in the HTML page i simply did a View Source (you open up notepad doing that) and did a View/Find of "User Tools" ......
__________________
Tim

Acer Aspire Lap Top/AMD 3000 +Sempron/1.5 gig ram/160 gig HD/Win XP SP2/NTL Broadband/Avira Anti Virus
Reply With Quote
  #4  
Old 6th-August-2007, 08:36 PM
CPS's Avatar
CPS CPS is offline
 
Join Date: Jan 2003
Location: Suffolk/ Gender Male
Posts: 1,444
Default

I came upon this late and saw Sky had solved the issue.
Better than I could in the time, I have to say,
especially with the added working example.
I found the relevant code by "View Source"
"Copy and Pasted whole page code" into Dreamweaver.
Selected code and page view,
clicked on the relevant tool bar and the code is highlighted.
Just needed the Jarva start and end tags as posted by Sky.
__________________
Knowledge is not knowing all the answers,
but knowing where to find the answers.

www.smitheram.co.uk

Moderator of, Web Design/Graphics Room.
P4-XP pro-IE7-B/B-ZA-AVG
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:54 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.