ziedinjsh Posted December 23, 2011 Report Share Posted December 23, 2011 (edited) tik tālu esmu ticis, bet netieku skaidrībā ar lietu sekojošu jquery $(function(){ $('#video').mouseover(function(){ $('#videoi').fadeIn(); }); $('#video').mouseleave(function(){ $('#videoi').fadeOut(); }); }); php while($data = mysql_fetch_array($video)){ $id = $data['id']; echo " <div id='video' style='background-image:url(http://img.youtube.com/vi/".$data['code']."/1.jpg);'> <div id='videoi'> ".$data['title']." </div> </div> "; } man viņš iefeidot tikai pirmo.. kā panākt lai viņš iefeidot katru uz kuru es uzbraucu ar pelīti!?!? Edited December 23, 2011 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
vostro Posted December 24, 2011 Report Share Posted December 24, 2011 (edited) Labāk pie katra id='video' pieliec klāt numuru ID un JS pusē +ID. Edited December 24, 2011 by vostro Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted December 24, 2011 Author Report Share Posted December 24, 2011 es laikam nesaprotu kā tās jāizdarta $(function(){ $('#video'+ID).mouseover(function(){ $('#videoi').fadeIn(); }); $('#video'+ID).mouseleave(function(){ $('#videoi').fadeOut(); }); }); <div id='video".$data['id']."' class='video' style='background-image:url(http://img.youtube.com/vi/".$data['code']."/1.jpg);'> Quote Link to comment Share on other sites More sharing options...
404 Posted December 24, 2011 Report Share Posted December 24, 2011 Kas traucē izmantot klases? $('.video').mouseover Quote Link to comment Share on other sites More sharing options...
mad182 Posted December 24, 2011 Report Share Posted December 24, 2011 (edited) Pārsauc id="video" par class="video". Nahrenizē id="videoi". Dokumentā katram ID jābūt unikālam. Un: $('.video').hover( function () { $(this).children().fadeIn() }, function () { $(this).children().fadeOut() } ); Edited December 24, 2011 by mad182 Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted December 24, 2011 Author Report Share Posted December 24, 2011 $('.video').mouseover( function () { $(this).children().fadeTo(150, 1) }, function () { $(this).children().fadeTo(150, 0.25) } ); while($data = mysql_fetch_array($video)){ echo " <div id='".$data['id']."' class='video' style='background-image:url(http://img.youtube.com/vi/".$data['code']."/1.jpg);'> <div> <a href='".url."video.php?do=play&id=".$data['id']."'>".$data['title']."</a> </div> </div> "; } } tagad man rādād uzreiz video nosaukums.. vajadzētu kad uzbracot ar peli uz div, tad lai rāda Quote Link to comment Share on other sites More sharing options...
mad182 Posted December 24, 2011 Report Share Posted December 24, 2011 Laboju. Un pieliec display:none nosaukumam. Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted December 26, 2011 Author Report Share Posted December 26, 2011 pieliku, bet tāpat neiet! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.