lundi 21 avril 2014

Inserting a jquery Function in wordpress


Vote count:

0




I am trying to insert the following function in wordpress but it doesn't seem to work whereas the same function works in fiddle.


jQuery



$(function(){
$('div.tags').delegate('input:checkbox', 'change', function() {
var $lis = $('.photo').hide();
//For each one checked
$('input:checked').each(function() {
$lis.filter('.' + $(this).attr('rel')).show();
});
});
});


I've placed the following code in my page template in wordpress and it doesn't seem to work



<script type="text/javascript">
jQuery(function($){
$('div.tags').delegate('input:checkbox', 'change', function() {
var $lis = $('.results > li').hide();
//For each one checked
$('input:checked').each(function() {
$lis.filter('.' + $(this).attr('rel')).show();
});
});
});

</script>


asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire