![]() |
|
|||||||
hi all, i am of an age where i will never ever master the art of understanding Java Script, but ...
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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"> Code:
</script> 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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
||||
|
||||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|