Blitz Posted June 9, 2011 Report Share Posted June 9, 2011 (edited) Atpuvenais kods un rezultāts: html <div id="thumbs"> <a href="./asdasdas.jpg" title="aaa" rel="vv"> <img src="./asdasdas.jpg"/> </a> </div> js $(document).ready(function(){ $("#thumbs a") .mouseover(function(){ alert(this); //rezultats atgriez http://host/asdasdas.jpg }); }); 1) visus citus elementus normāli var selektēt, bet selektējot a nevis atgriež objektu bet URLi. wtf? 2) ka elegantāk padot linka relatīvo URLi jquery apstrādei? Edited June 9, 2011 by Blitz Quote Link to comment Share on other sites More sharing options...
0 Rincewind Posted June 9, 2011 Report Share Posted June 9, 2011 alert($(this)); Quote Link to comment Share on other sites More sharing options...
0 indoom Posted June 9, 2011 Report Share Posted June 9, 2011 Tas this arī ir objekts. Tikai alerts rāda href daļu. Labāk izmanto firebug console.log() alert vietā ja 2) punkā ar relatīvo URLi domāji to href, kas ir norādīts sourcē, nevis ar hostu klāt, pamēģini $(this).attr('href') Quote Link to comment Share on other sites More sharing options...
0 Blitz Posted June 9, 2011 Author Report Share Posted June 9, 2011 (edited) alert($(this)); ai, tā arī domāju ka vienkārsi lohs esu (ofisā +33c) un relativais URL ari ok dabunams. paldies. Edited June 9, 2011 by Blitz Quote Link to comment Share on other sites More sharing options...
0 Kemito Posted June 10, 2011 Report Share Posted June 10, 2011 (ofisā +33c) Tādā žaronā var smadzenes uzcept :D Quote Link to comment Share on other sites More sharing options...
Question
Blitz
Atpuvenais kods un rezultāts:
html
js
1) visus citus elementus normāli var selektēt, bet selektējot a nevis atgriež objektu bet URLi. wtf?
2) ka elegantāk padot linka relatīvo URLi jquery apstrādei?
Edited by BlitzLink to comment
Share on other sites
4 answers to this question
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.