www.webdeveloper.com
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2012
    Posts
    13

    IE & Chrome having issues with # links

    I'm not sure what the deal is. Firefox works fine, IE and Chrome WERE working.

    Here's my link.
    Code:
    		<div class="mainthumbs">
    			<a href="#" onclick="hdr.id='hdr1';showitem('toggle1');hideitem('toggle2');hideitem('toggle3');hideitem('toggle4');hideitem('toggle5')"><img src="<?php bloginfo('template_directory'); ?>/contentbg/thumb1.png"></a>
    			<a href="#" onclick="hdr.id='hdr2';showitem('toggle2');hideitem('toggle1');hideitem('toggle3');hideitem('toggle4');hideitem('toggle5')"><img src="<?php bloginfo('template_directory'); ?>/contentbg/thumb2.png"></a>
    			<a href="#" onclick="hdr.id='hdr3';showitem('toggle3');hideitem('toggle2');hideitem('toggle1');hideitem('toggle4');hideitem('toggle5')"><img src="<?php bloginfo('template_directory'); ?>/contentbg/thumb3.png"></a>
    			<a href="#" onclick="hdr.id='hdr4';showitem('toggle4');hideitem('toggle2');hideitem('toggle3');hideitem('toggle1');hideitem('toggle5')"><img src="<?php bloginfo('template_directory'); ?>/contentbg/thumb4.png"></a>
    			<a href="#" onclick="hdr.id='hdr5';showitem('toggle5');hideitem('toggle2');hideitem('toggle3');hideitem('toggle4');hideitem('toggle1')"><img src="<?php bloginfo('template_directory'); ?>/contentbg/thumb5.png"></a>
    		</div>
    When you click the link, it's supposed to display text and change the background. For some reason you can click one link and it works, but if you try to click another it doesn't do anything.

  2. #2
    Join Date
    Feb 2003
    Location
    Chicago Area, IL
    Posts
    5,736

  3. #3
    Join Date
    Aug 2012
    Posts
    13
    I'm just learning jquery, so I'm not entirly sure what you mean.
    I think I found what I'm looking for,
    Code:
     $(this).click(function(){ return false; }
    Here's my code:
    Code:
    <script type="text/javascript">
    function hideitem(id){document.getElementById(id).style.display = "none";}
    function showitem(id){document.getElementById(id).style.display = "inline";}
    </script>
    and at each link
    Code:
    <a href="#" onclick="hdr.id='hdr1';showitem('toggle1');hideitem('toggle2');hideitem('toggle3');hideitem('toggle4');hideitem('toggle5')"><img src="<?php bloginfo('template_directory'); ?>/contentbg/thumb1.png"></a>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

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



Recent Articles