need help in finishing javascript program
hi
I am a total nitwit in javascript programming
Nevertheless with 'copy and paste' and by using common sense javascript became a valuable part of my html websites
I wrote a testprogram to prevent scrolling without clicking (problem for webstats). Pages are presented 1 by 1 by unhiding a div block
see: http://paradigm-shift-21st-century.nl/test1.html
So far I managed, but the remaining problem is that you need to unselect every page before selecting a next one.
Has anyone a solution where selecting automatically means unslecting/unhidin the former page
Thanks a lot in advance
Henkt
Please with example, because my javascript knowledge is very little
first of all, try to fix the CSS and HTML and then understand what did you mean with this line:
Code:
var link = document.getElementById("linkId1");
use [code]YOUR CODE GOES HERE [/code] or burn in Hell
Thanks Padonak
Hello Padonak
I'm sorry but your reaction wasn't really helpful
I don't worry about 'correct' css, but my html i always check. Because that's what searchengines do too.
No errors
And the program works, though not satisfactorily. The result is not what I looked for.
You might explain what you mean with your remark
Henkt
And the linkid is superfluous. I already noticed
Code:
function divToHide(divToHideOrShow) {
var div = document.getElementById(divToHideOrShow);
if (divToHide.lst&&divToHide.lst!=div){
divToHide.lst.style.display = "none";
}
if (div.style.display == "block")
{
div.style.display = "none";
}
else
{
div.style.display = "block";
}
divToHide.lst=div;
}
fabulous Vic
Hi Vic
It works
I have to study to grasp why, but GREAT!
Thanks a lot
Originally Posted by
henkt
...
I don't worry about 'correct' css, but my html i always check. Because that's what searchengines do too.
No errors
...
1. here is your page markup validation result - 9 Errors, 2 warning(s)
2. if you don't worry about 'correct' css, be prepared to get many troubles with Javascript. just for your info, the CSS validator says that your stylesheet has at least 7 errors.
use [code]YOUR CODE GOES HERE [/code] or burn in Hell
Thread finished, Vic gave a correct answer
Hi Padonak
Keep focusing on the essence.
I use html validator and saw 2 errors but not essential ones, caused by a forgotten <div> command. Nothing to worry about, as you surely noticed
Henkt
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks