- Posts: 48
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
autotab and slidertoggle()
- bayemanel
- Topic Author
- Offline
- Senior Member
Less
More
8 years 4 months ago #127831
by bayemanel
autotab and slidertoggle() was created 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.
- bayemanel
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 48
- Thank you received: 1
8 years 4 months ago #127833
by bayemanel
Replied by bayemanel on topic autotab and slidertoggle()
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>
<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.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
8 years 4 months ago #127876
by tpartner
1) Copy the plugin files to your template directory
2) In startpage.pstpl, after the {TEMPLATEJS} tag, add something like this :
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.
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.