Find the answer to your Linux question:
Results 1 to 3 of 3
I wrote this up and it doesn't work. Where have I stuffed up? Code: <SCRIPT type="text/javascript"> function selector('glancej') { document.getElementById('glance') {style.display='block'}; document.getElementById('front') {style.display='none'}; } function selector('frontj') { document.getElementById('glance') {style.display='none'}; document.getElementById('front') ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Banned
    Join Date
    Aug 2011
    Posts
    43

    I wrote up this simple JavaScript, but it doesn't seem to work. Where


    I wrote this up and it doesn't work. Where have I stuffed up?

    Code:
    <SCRIPT type="text/javascript">
    	function selector('glancej') {
    		document.getElementById('glance') {style.display='block'};
    		document.getElementById('front') {style.display='none'};
    	}
    	function selector('frontj') {
    		document.getElementById('glance') {style.display='none'};
    		document.getElementById('front') {style.display='block'};
    	}
    </SCRIPT>
    
    <SPAN onclick="selector('glancej');">GLANCE</SPAN>
    <SPAN onclick="selector('frontj');">FRONT</SPAN>
    
    <IMG alt="" id="glance" src="glance.png">
    <IMG alt="" id="front" src="front.png">

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,296
    Try replacing lines like
    Code:
    document.getElementById('glance') {style.display='block'};
    with
    Code:
    document.getElementById('glance').style.display='block';
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    Conkybots: Interactive plugins for your Conkys!

  3. #3
    Banned
    Join Date
    Aug 2011
    Posts
    43
    Thanks Elija! (Y)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •