Sourja Banerjee
Sourja Banerjee

Reputation: 1

Can anyone help me with jQuery selectors please?

I want to select class="item" as draggable but this selector is not working:

<body>
 <div id="contentwrapper">
  <div id="contentcolumn">
   <div class="innertube" >
    <ul class="products">
     <li>
      <a href="#" class="item">   // i want to select this
      <img src="images/shirt1.gif"/>
      <div>
       <p>Balloon</p>
       <p>Price:$25</p>
      </div>
     </a><!-- more products like this --></li></ul></div></div></div>
<script>
$('.item').draggable(....)    // not working
</scipt>
</body>

Upvotes: 0

Views: 75

Answers (3)

Royi Namir
Royi Namir

Reputation: 148524

remove the wrong </scipt> ..........

Upvotes: 1

PizzaMartijn
PizzaMartijn

Reputation: 122

The jquery code seems to be correct. maybe it works better if you do it like this:

$(document).ready(function(){
    $('.item').draggable(....)
});

this way it wont try to find the tags before the complete DOM is loaded.

Upvotes: 1

iehrlich
iehrlich

Reputation: 3592

1) < script language=...>

2) put all this stuff into document.ready() callback description.

Upvotes: 0

Related Questions