I make the internet beautiful. Front End Developer with a crush on the back end. Hubspot COS Penguin. Favorite color is #bada55 - I think I may have just told a lie! This purple color is more like my favorite color, I just wanted to write badass


Changing a DATA-ICON in jQuery Mobile

jquerymobileStarted playing with jQuery Mobile last night. Friends have been wanting me to make a tournament app that will help us stay organized when playing ping pong on Monday Nights. I said ping pong, not beer pong. Second question is always…. “Do you guys hit it from like 20 feet back?” Sure, if the garage was big enough, it would be like that, but we are somewhat limited. There are occasions when one side can get that far back. As the rambling goes on I will go ahead and say it seems that jQuery Mobile doesn’t have a way to just change the data-icon using the .attr('data-icon', 'plus');. Of course I would fight with it for about 45 minutes. Well, I wanted to get this down here this morning so that I could make sure I would follow up with an answer here as soon as I figure it out! If you want to see what is going on so far – http://jsbin.com/udaziy/11/edit Oh yeah. So I was being silly. $(this) .find('.ui-icon') .addClass('ui-icon-delete') .removeClass('ui-icon-plus'); I was targeting the wrong
  • element, causing this to get all goofed up. Sometimes a second set of eyes is needed!

    Tags: , , ,

    Trackback from your site.

    Leave a comment

  • What about a meepface?

    Somebody’s Instagram Feed