fancybox - combine jquery rules -
i have jquery
$('#1').fancybox({ 'width': '50%', 'height': '90%', 'autodimensions': false, 'type': 'ajax', 'ajax': { datafilter: function(data) { return $(data).find('.news:first')[0]; } } }); $('#2').fancybox({ 'width': '50%', 'height': '90%', 'autodimensions': false, 'type': 'ajax', 'ajax': { datafilter: function(data) { return $(data).find('.news:eq(1)')[0]; } } }); is there possibility combine these 2 1
thnx
your biggest problem datafilter try this:
$('#1, #2').each(function(i, el) { $(el).fancybox({ 'width': '50%', 'height': '90%', 'autodimensions': false, 'type': 'ajax', 'ajax': { datafilter: function(data) { return $(data).find('.news:eq(' + + ')')[0]; } } }); });
Comments
Post a Comment