jquery - Selecting the child of a block in a plugin -
i'm working on plugin right , can't work.
i want make container this one
if click on block, cover should move specific direction.
every time want child of .coverframe-container
, gives me link of file + ' > .cover'
here code:
$.fn.coverblock = function () { // settings var settings = $.extend({ direction: 'up', speed: 400 }); $(this).click(function () { element = this; console.log(this + ' .cover'); }); } $(function () { $('.coverframe').coverblock(); });
this in debug now.
the console-log in click-function gives me this:
file:///g:/wamp/www/training/index.html# .cover
without addition +' .cover'
gives me following:
<a href="#" class="coverframe" style="display: block; height: 100px; width: 100px;">...</a>
how can fix can select child , work it?
try using $(this) within click function.
Comments
Post a Comment