Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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,907
    Try replacing lines like
    Code:
    document.getElementById('glance') {style.display='block'};
    with
    Code:
    document.getElementById('glance').style.display='block';
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!


    The Fifth Continent

  3. #3
    Thanks Elija! (Y)

  4. $spacer_open
    $spacer_close

Posting Permissions

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