开发者

Jquery image in div, makes the code act strange

Hey there, third related question to this code, hopefully the final one:).

This code seems to work pretty smooth:

$(document).ready(function(){

$(".photo").mouseenter(function() {

 $(this).html('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0" width="170" height="125"><param name="movie" value="http://static.awempire.com/flash/live_feeds/live_feed.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><para开发者_开发技巧m name="flashvars" value="appletroot=http://static.awempire.com/flash/live_feeds/&appletskin=template8/template01.swf&appletcol=900000&psid=ddany23&campaign_id=20520&pstour=t1&psprogram=REVS&site=jsm&flags=137438953473,137438953504,1,32&lp_lang=auto" /><embed src="http://static.awempire.com/flash/live_feeds/live_feed.swf" width="170" height="125" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" flashvars="appletroot=http://static.awempire.com/flash/live_feeds/&appletskin=template8/template01.swf&appletcol=900000&psid=ddany23&campaign_id=20520&pstour=t1&psprogram=REVS&site=jsm&flags=137438953473,137438953504,1,32&lp_lang=auto"></embed></object>');
});

$(".photo").mouseleave(function() {
  $(this).html('ffff');
});

The problem is .photo div (i have 10 different divs)

If photo div is empty, or has plain text inside, everything works fine. BUT, if i have a photo inside photo div, which on mouseenter will be replaced with the flash movie, everything brakes, the movie isn't loaded properly and it isn't replaced promptly with "fff" on mouseleave.

The link is to an adult site, unfortunately I can't provide this here as it is against the rules and may be considered offensive and unsuitable for all audiences.

Thank u!

If i delete everything inside .photo, the above code works perfectly. If a live the link, it works to.. only if i put an image, it brakes the code.

PS. here is the html code, it's on wordpress index.php

<div class="section"><!-- Start Section -->

<div class="photo"><!-- Start Photo -->
    <div class="transparency"></div>
    <div class="performer"><p><? echo $perf; ?></p></div>
    <a href="<?php the_permalink(); ?>" title="<? echo ''.$perf.''; ?>'s bio - <? echo ''.get_the_title().''; ?>"><img src="<? echo ''.$pic.''; ?>" width="180" height="135" alt="<? echo ''.get_the_title().''; ?>" style="display:block"/></a>
</div><!-- End Photo -->

<div class="left"><!-- Start left -->
    <a href="<?php the_permalink(); ?>" title="<? echo ''.$perf.''; ?>'s Bio Page and Live Cam">Bio Page</a>
</div><!-- End Left -->

<div class="right"><!-- Start Right -->
    <a href="the linkx" target="_blank" title="Free Chat with <? echo ''.$perf.''; ?> " rel="nofollow">Free Chat</a>
</div><!-- End Right -->


Kid of solved it;) Added hoverIntent, things started to get screwy when I changed the mouse to fast from one div to another. Thax

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜