SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Bangladesh
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Tooltip not shown if Ajax

    Hi,

    I have implemented a site where I made a tooltip, show when mouseover an item. here is the site http://amerimav.com/amerimav/rashidul/googlebd

    The problem is data got from a remote server using ajax. I perform jQuery .hover() on the content got through Ajax. not use .live(). So Now the situation is in IE tooltip shown but in FF and Safari tooltip is not shown.

    Here is the js code and make the Ajax call..this is index.php
    Code:
    <!-- Get the browser height and width and make an ajax call -->
    		<script type="text/javascript">
    		$(document).ready(function(){
    			var bHeight = $(window).height();
    			var bWidth = $(window).width();
    			$.post("index2.php", { width: bWidth, height: bHeight },
    		   		function(data){
    		     		//alert("Data Loaded: " + data);
    		     		$("#content").html(data);
    		   		});
    		});
    		</script>
    Here is the main PHP code where using CSS and JS hover implemented.
    PHP Code:
    $html .= '<a target="_blank" href="'.$arrBld["itemLink"].'"><div class = "title_div" '.$styletext.'>';
                    
    $html .= $arrBld['itemTitle'];
                    
    $html .= '<span class="tooltips"><span class="tooltipsIn"><span class="tooltipsInner">';
                    
    $html .= $arrBld['itemDesc'];
                    
    $html .= '<br />'.$arrBld['sourceTitle'];
                    
    $html .= '</span></span></span>';
                    
    $html .= '</div></a>' 
    Here is the jQuery code:
    Code:
    $('.tooltips').parent().hover(function(){
    Full JS file is here http://amerimav.com/amerimav/rashidu...s/js/script.js

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's loading in one browser but not the other, it may be your CSS and not the javascript (especially sense you are using jquery).

    Can you strip out the CSS and just fire off the event to see if it at least loads?
    Follow me @YaderHernandez


Tags for this Thread

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
  •