Link to home
Start Free TrialLog in
Avatar of Elxn
ElxnFlag for United States of America

asked on

jQuery-switchButton

I am using this script: code.

I am trying to get the switch button to show up like the example (view examples here), but for some reason it isn't working and I don't know why.

jQuery I'm using:
$("input#switch").switchButton({
   labels_placement: "right"
});

Open in new window


HTML I'm Using:
<div class="switchButton">
	<input id="switch" type="checkbox" name="anonymous" value="1" checked>
</div>

Open in new window


The URL It's supposed to work on:  http://girlzunderground.com/rate-pics.php  (the code in question is ajaxed to the page, but you can see it with Chrome's "inspect element" feature.)

The checkbox on this page is in the upper left hand corner of the box with the stars in it.  Right now it's just a plain checkbox and I would like to have it be the switch button like on the example I provided.

Thanks for the help!
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Elxn

ASKER

Thanks for the comment.  I tried it out and added jQuery UI 1.11.1.  I also changed the binding function to be like yours.  But it still doesn't work.  I have no idea why!  Any other thoughts?

Thanks!
check source of this working page : http://fiddle.jshell.net/5ec1gvqs/4/show/
teher's no more
provide a link to your page
<link rel="stylesheet" type="text/css" href="/css/result-light.css">

is not part of the plugin but from jsfiddle, you don't need it
Avatar of Elxn

ASKER

http://girlzunderground.com/rate-pics.php

That is where I'm trying to use it.  My original post has a little more detail.

Yeah I seem to have got everything as you can see in the head of my doc.  Its strange how this isn't working.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Elxn

ASKER

Ha!  That putting jquery ui before the switch js worked!  crazy...  I bet I woulda been absolutely lost with that being the problem.  I guess it takes experience to know this and now I know this trick.  Thanks man!
Avatar of Elxn

ASKER

Great advice.  It took experience to solve this problem!