1

i have a list of objects that once a user clicks on i would like to change-

my code is

$(function() {

        $( ".ui-state-default" ).draggable({
            revert: "invalid",
            zIndex: 2700

and the draggable item is this- (it has some css styling which i would want to change as well)

<li class="ui-state-default"><a href="#">North Right</a></li>

I would like to change the whole li to just an icon instead of the text and everything. reason being that im dragging items onto a map and having the text would hide certain parts

Chris Mccabe
  • 1,902
  • 6
  • 30
  • 61
  • Have you seen the [Draggable demos](http://jqueryui.com/demos/draggable/#visual-feedback)? I assume you want something like the "custom helper"? – andyb Jul 05 '11 at 10:49
  • i have seen people using $(ui.draggable).attr('src','/path/to/different/image'); to update an image but i was think i would need to update the whole html being dragged. im not sure how to do this – Chris Mccabe Jul 05 '11 at 10:53

1 Answers1

0

Like this?

I adapted the clone helper answer from Can't drop jquery ui helper on droppable

Community
  • 1
  • 1
andyb
  • 43,435
  • 12
  • 121
  • 150
  • perfect, i was siting playing with this and getting nowhere- $(ui.helper).text("x"); $(ui.helper).addClass("ui-draggable-helper"); – Chris Mccabe Jul 05 '11 at 11:33