- Posts: 22
COMMUNITY FORUM
Pop up images
- politicaldoubts
-
Topic Author
- Offline
- Junior Member
Less
More
8 years 7 months ago #157950
by politicaldoubts
Pop up images was created by politicaldoubts
Hallo!
Images in my fulltext dont open in pop up, althouth i have add to them an <a class="modal" rel="{handler: 'image'}" href="...">
An example -> www.politicaldoubts.com/thrace/item/1007-anatoliki-makedonia-thraki-ora-gia-anaptyksi
What i am doing wrong;
Is it possible to add classes automatically to every image in fulltext, and not do it manually every time; With jquery code for example;
Thanks for your time!
Images in my fulltext dont open in pop up, althouth i have add to them an <a class="modal" rel="{handler: 'image'}" href="...">
An example -> www.politicaldoubts.com/thrace/item/1007-anatoliki-makedonia-thraki-ora-gia-anaptyksi
What i am doing wrong;
Is it possible to add classes automatically to every image in fulltext, and not do it manually every time; With jquery code for example;
Thanks for your time!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 7 months ago #157976
by Krikor Boghossian
Replied by Krikor Boghossian on topic Pop up images
Hello the script does not get triggered this way.
You can use jQuery's wrap() for all of the images and then calling the lightbox. I would suggest however not using Squeezebox and using the new syntax
You can use jQuery's wrap() for all of the images and then calling the lightbox. I would suggest however not using Squeezebox and using the new syntax
<a data-k2-modal="image" ...
Please Log in or Create an account to join the conversation.
- politicaldoubts
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
8 years 7 months ago #157990
by politicaldoubts
Replied by politicaldoubts on topic Pop up images
thanks! that worked!!! i ll try now the jquery code and i hope that it ll works too,
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 7 months ago #157993
by Krikor Boghossian
Replied by Krikor Boghossian on topic Pop up images
Let me know how it went.
Please Log in or Create an account to join the conversation.
- politicaldoubts
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
8 years 7 months ago #158022
by politicaldoubts
Replied by politicaldoubts on topic Pop up images
i used the following code:
<script>
(function ($) {
$(".itemFullText img").each(function() {
var src = $(this).attr('src');
var a = $('<a/>').attr({href: src, 'data-k2-modal': 'image'})
$(this).wrap(a);
});
})(jQuery);
</script>
and it worked fine! thanks for your help!
<script>
(function ($) {
$(".itemFullText img").each(function() {
var src = $(this).attr('src');
var a = $('<a/>').attr({href: src, 'data-k2-modal': 'image'})
$(this).wrap(a);
});
})(jQuery);
</script>
and it worked fine! thanks for your help!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 7 months ago #158025
by Krikor Boghossian
Replied by Krikor Boghossian on topic Pop up images
Great news buddy :)
Nice to be of assistance.
Nice to be of assistance.
Please Log in or Create an account to join the conversation.