Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

autotab and slidertoggle()

More
9 years 10 months ago #127831 by bayemanel
how to put a pluging autotab and slidertoggle() into limesurvey or in general how to put a plugin of jquery in limesurvey
The topic has been locked.
More
9 years 10 months ago #127833 by bayemanel
i wanna use the script but i have a big problem
<script type="text/javascript" charset="utf-8">

$(document).ready(function(){

// Insert show/hide divs before all group wrapper divs
$('<div class="groupToggler"><span></span></div>').insertBefore('div[id^="group-"]');

// Add some text to the show/hide divs
$('.groupToggler span').each(function(i) {
($( this ).text('Show/Hide Group '+(i+1)+''));
});

// Add some styles to the show/hide divs
$('.groupToggler').css({
'padding':'5px 0 10px 0',
'text-align':'center'
});
$('.groupToggler span').css({
'text-decoration':'underline',
'cursor':'pointer'
});

// Add some hover effects to the show/hide divs
$(".groupToggler span").hover(
function () {
$(this).css({
'text-decoration':'none',
'font-weight':'bold'
});
},
function () {
$(this).css({
'text-decoration':'underline',
'font-weight':'normal'
});
}
);

// Initially hide all of the groups
// Toggle their visibility when the show/hide is clicked
$('.groupToggler span').click(function() {
$(this).parent().next().toggle();
return false;
}).parent().next().hide();

// Display any groups that have unanswered mandatories
$('.errormandatory').parents('div[id^="group-"]').show();

// Some tidying up
$('h1').next().next().hide();
$('.surveywelcome').css({'margin-bottom':'10px'});
$('.surveywelcome').next().hide();
$('.surveywelcome').next().next().hide();

});

</script>
The topic has been locked.
More
9 years 10 months ago #127876 by tpartner
Replied by tpartner on topic autotab and slidertoggle()

how to put a pluging autotab and slidertoggle() into limesurvey or in general how to put a plugin of jquery in limesurvey


1) Copy the plugin files to your template directory

2) In startpage.pstpl, after the {TEMPLATEJS} tag, add something like this :
Code:
<script type="text/javascript" src="{TEMPLATEURL}jquery.autotab.min.js"></script>

3) Then you should be able to access .autotab() in template.js or your question source.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: bayemanel
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose