/    Sign up×
Community /Pin to ProfileBookmark

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: [url]http://paradigm-shift-21st-century.nl/test1.html[/url]

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

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@PadonakJun 25.2012 — 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");[/CODE]
Copy linkTweet thisAlerts:
@henktauthorJun 26.2012 — 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
Copy linkTweet thisAlerts:
@henktauthorJun 26.2012 — And the linkid is superfluous. I already noticed
Copy linkTweet thisAlerts:
@vwphillipsJun 26.2012 — [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;
}
[/CODE]
Copy linkTweet thisAlerts:
@henktauthorJun 26.2012 — Hi Vic

It works?

I have to study to grasp why, but GREAT!

Thanks a lot?
Copy linkTweet thisAlerts:
@PadonakJun 26.2012 — ...

I don't worry about 'correct' css, but my html i always check. Because that's what searchengines do too.

No errors

...[/QUOTE]


  • 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.
  • Copy linkTweet thisAlerts:
    @henktauthorJun 27.2012 — 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?
    ×

    Success!

    Help @henkt spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.20,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...