SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    IE Issue with Website

    Hello Guys,

    I'm having issues with this Rollover effect I'm doing, it works fine in other Browsers but IE, when you rollover the project section you want to view then leave it, it disappears instead of rolling back up.

    Any reason why, here is the website...

    http://keatinginc.ca/category/projects/

    Thanks,

    Mike

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,344
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Don't know if its related to your issue but you have a JS error as you are referencing jquery before it has loaded.

    Code:
    <script type="text/javascript">
    $(function(){
           $("a").each(function(){
                   if ($(this).attr("href") == window.location.pathname){
                           $(this).addClass("selected");
                   }
           });
    });
    </script>
    
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    Move the jquery script above any functions that call it.

    Code:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript">
    $(function(){
           $("a").each(function(){
                   if ($(this).attr("href") == window.location.pathname){
                           $(this).addClass("selected");
                   }
           });
    });
    </script>

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,344
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Ok, tracked the issue down to this script:

    Code:
    	<!--[if IE]>
    		<script src="http://keatinginc.ca/wp-content/themes/keating/js/ie.js"></script>
    	<![endif]-->

    In this script you are setting the height of the element to 112px on mosueover and then 8pxhigh on mouseout.

    Code:
    $(document).ready(function(){
    			$('.desc-drop').mouseover(function(){
    				$(this).stop(false,false).animate({height:"112px"}, 'fast');
    			});  
    
    			$('.desc-drop').mouseout(function(){
    				$(this).stop(false,false).animate({height:"8px"}, 'fast');
    			}); 
    		});

    It looks like you should be using the same height as the css:

    Code:
    $(document).ready(function(){
    			$('.desc-drop').mouseover(function(){
    				$(this).stop(false,false).animate({height:"530px"}, 'fast');
    			});  
    
    			$('.desc-drop').mouseout(function(){
    				$(this).stop(false,false).animate({height:"190px"}, 'fast');
    			}); 
    		});
    Of course animating by pixel height means it won;t work properly if there is more content or if the text is enlarged. However css needs a height to animate and jquery is very jumpy with auto height.

  4. #4
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul,

    Seems to work now nicely, any reason why this is not working on iPad, do you know why it could be?

  5. #5
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Also, noticed couple other things on IE7, the Navigation is incorrectly situated, Navigation items spread beyond the body and the footer headings are not centered between borders. Is there anyway that I can fix these so it appears the same in IE7 as well as all other browsers. As well someone mentioned in IE7, the white text on the orange banner in the slider is behind the banner even though it has a larger z-index, anyway I can solve this issue as well.

    Thanks

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,344
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by mbond5 View Post
    Thanks Paul,

    Seems to work now nicely, any reason why this is not working on iPad, do you know why it could be?
    The ipad doesn't do hover - it's a touch device.

    These type of effects are not really a good idea if you are going for ipad or mobile support. The ipad will actually open flyout menus on touch as long as the element "touched" is a clickable element such as a link. It will not however close them until another link is touched.

    You could add a link as the trigger on the top level menus here:

    Code:
    <li class="desc-drop">
     <div class="project-title">
      <h1><a href="#">Pikangikum First Nations Schools</a></h1>
    </div>
    
    and here....
    
    <li class="desc-drop">
      <div class="project-title">
    	<h1><a href="#">Court House</a></h1>
    </div>
    
    
    and so on....
    That will allow the menu to open when you tap the heading (BTW you should only have one h1 per page outside of html5).

    You may want to add plus symbols or something to the heading to show that more can be revealed otherwise ipad users won't know what to click.

    Or you could detect the ipad and give separate rules to have the content displayed in full by default. Or use the mobile first approach and have the basic no frills site by default and then enhance for more capable devices.

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,344
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by mbond5 View Post
    the footer headings are not centered between borders.
    Thanks
    That's because you have not taking into account the default margins on elements. In some browsers the p element gets a top margin by default and in others it doesn't so you need to set it explcitly yourself.

    Code:
    p{margin:1em 0}/* or whatever you need for default */

    BTW you still have that IE JS error mentioned in post #2.

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,344
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by mbond5 View Post
    Also, noticed couple other things on IE7, the Navigation is incorrectly situated,
    You failed to set a top position for the absolute nav so it gets placed at auto which may differ between browsers. Add top:0 to #nav and remove the float as it is redundant.

    As well someone mentioned in IE7, the white text on the orange banner in the slider is behind the banner even though it has a larger z-index, anyway I can solve this issue as well.
    I don't think that issue can't be solved in IE7 with your current structure as it looks like you are trying to insert a positioned element between a positioned parent and its child. In Ie7 positioned parents are "atomic" and you can't place an element outside of the current context between the parent and child. Only unrelated positioned elements can be interleaved like that.


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
  •