Created
June 4, 2012 17:49
-
-
Save vgheri/2869813 to your computer and use it in GitHub Desktop.
plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.iLikeIt = function (options) { | |
var div = createVotingDiv(); | |
// element is the carousel | |
var element = $(this); | |
element.append(div); | |
element.carousel({ | |
interval: false, | |
pause: "hover" | |
}); | |
element.carousel('pause'); | |
$(".carousel-vote").on("mouseenter", function () { | |
preloadRating(); | |
}); | |
$(".vote-item").on("mouseover", "img", function () { | |
var elem = $(this); | |
displayRating(elem.attr("id"), true); | |
}); | |
$(".vote-item").on("mouseout", "img", function () { | |
var elem = $(this); | |
displayRating(elem.attr("id"), false); | |
}); | |
$(".vote-item").on("click", "img", function () { | |
var elem = $(this); | |
registerVote(elem, options.postUrl); | |
}); | |
return this; //allow chaining | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment