- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
June 8, 2014 at 5:46 am #10139rizoneParticipant
I have an array of links like this:
<a title="G0" id="hotel_img_0" rel="hotel_img" href="#"></a> <a title="G1" id="hotel_img_1" rel="hotel_img" href="#"></a> <a title="G2" id="hotel_img_2" rel="hotel_img" href="#"></a> <a title="G3" id="hotel_img_3" rel="hotel_img" href="#"></a>
how should I make fancybox work?
I have no class for anchors that is why cannot use$(".class_name").fancybox()
I try the same id for all of anchors and$("#id_value").fancybox()
– fancybox does not work.
Help plese.June 8, 2014 at 6:17 am #10140jfkParticipantyou can bind fancybox to all elements with the same
rel
attribute (and without having any class) like$("a[rel=hotel_img]").fancybox();
See JSFIDDLE
EDIT :
You could also group elements with different
rel
attributes within the same fancybox initialization script like :$("a[rel=hotel_img], a[rel=standart_room_img], a[rel=agents_room_img]").fancybox();
See updated JSFIDDLE
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.