Check out the LimeSurvey source code on GitHub!

jquery conflict?

More
6 years 4 weeks ago - 6 years 4 weeks ago #55809 by waitz
I tried to add a feature where a link in a question is being opened in lightbox. I used the jquery plugin from leandrovieira.com/projects/jquery/lightbox/

I added the following in my templates startpage.pstpl:
<link rel="stylesheet" type="text/css" href="{TEMPLATEURL}/css/jquery.lightbox-0.5.css" media="screen" />
<script type="text/javascript" src="{TEMPLATEURL}"></script>
<script type="text/javascript" src="{TEMPLATEURL}/js/jquery.lightbox-0.5.js"></script>
PS: The second line calls (slash)js(slash)jquery(dot)js after templateurl. It wouldn't show here.

In global settings I set "Filter HTML for XSS" to No, and in the question where I wanted the link, I added:
<script type="text/javascript">
$(function() {
	// Use this example, or...
	$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	// This, or...
	$('#gallery a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	$('a.lightbox').lightBox(); // Select all links with lightbox class
	// This, or...
	$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above
});
</script>
But it seems that I get a conflict with limesurvey's js, becuase I loose datepickers and the process line.

Does anyone know a work-around?

Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
Last Edit: 6 years 4 weeks ago by waitz.

Please Log in to join the conversation.

More
6 years 4 weeks ago #55817 by tpartner
Why are you adding a link to a jquery.js file in your template directory? Does your plugin not work with the shipped version of jQuery (which, in LS version 1.90, is jQuery version 1.3.2)?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
6 years 4 weeks ago #55834 by waitz
Oh, I wasn't aware of that... Thanks.
I have been searching how to use lightbox with jquery 1.3.2, but I don't really get it.

I add rel="lightbox"; to the link, right? But I also need to add a script at the top of the question, no? I have tried a couple, but it won't work....

Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form