сейчас на сайте:
Лучшие сказки мира
Детектив и фантастика
Песни прошлых лет
Для досуга
смотреть оглавлениепримерразмер кода
Example 1:
I want to make sure you read the 3rd paragraph that I am referring to now, but which you cannot see because it is lower down the page So ... I create a keyword by emphasising the word paragraph, in bold, and make it a link.
When you click the link the page scrolls down to bring the paragraph into view, the background of the paragraph flashes, and the page scrolls back up.
Example 2:
I want to point out a specific word in that paragraph
Try Me
The target is simply: Highlighted Text
Each separate caller and individual target must have its own unique identity, but you can call the same target with more than one caller.
IE: Caller1 - Target1, Caller2 - Target1
Try Me and Me
Keyword Highlighted text Keyword
Note: In order to test the script yourself, once you have copied the above into your page you need to make your page long enough to scroll. To do this add about 20 line breaks between caller1, target1, and caller2.
The script ended up longer than anticipated because I had to include some preventative measures to stop the browser locking up. This happened because I am using the while statement, and through experimental mishaps (positioning the caller and/or target at the extreme top or bottom of the page) I found that if the scroll went over the upper and lower limits of the page the while loop would not terminate, hence a lockup. Function Init and two if statements in each function prevent this from happening.
If you use this script and should have the misfortune to experience a lockup just increase the variable Top_Limit value