inherit
169267
0
Nov 29, 2024 7:30:04 GMT -8
Mike
Praise God Almighty!
1,534
July 2011
riccetts
|
Post by Mike on Jun 7, 2015 12:31:49 GMT -8
I have a plugin that uses java script. $('#wrapper').css('box-shadow','inset 0 0 400px #ef9201'); is my css that i want to turn it on and off with a check box. Can any buddy help with this?
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Jun 8, 2015 11:32:47 GMT -8
Hey Mike -- to clarify, are you saying you want members to be able to toggle the box shadow of the forum wrapper on and off with a checkbox? Where would that checkbox appear?
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jun 8, 2015 13:07:42 GMT -8
I have a plugin that uses java script. $('#wrapper').css('box-shadow','inset 0 0 400px #ef9201'); is my css that i want to turn it on and off with a check box. Can any buddy help with this? Just turn it off with it's own default value javascript function togglecheck() { check to see if its checked yet then run this if its not
$('#wrapper').css('box-shadow','inset 0 0 400px #ef9201');
else
$("#wrapper").css("box-shadow", "none");
}
HTML <input type="checkbox" id="customcheckbox" onclick="togglecheck();">
Note that the javascript function is not fully developed and would take some tinkering
|
|
inherit
169267
0
Nov 29, 2024 7:30:04 GMT -8
Mike
Praise God Almighty!
1,534
July 2011
riccetts
|
Post by Mike on Jun 8, 2015 19:37:26 GMT -8
|
|
inherit
169267
0
Nov 29, 2024 7:30:04 GMT -8
Mike
Praise God Almighty!
1,534
July 2011
riccetts
|
Post by Mike on Jun 9, 2015 7:08:14 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓This is my plugin where would I put the code in my plugin? $(document).ready(function(){ var shad=pb.plugin.get('border_around_forum_plugin').settings.bafp.shadow; var bac=pb.plugin.get('border_around_forum_plugin').settings.bafp; for(i=0;i<bac.length;i++) { var theme=bac .theme; console.log(theme); if(theme.length > 0){ for(r=0;r<theme.length;r++){ if(pb.data('user').theme_id==theme[r]){ var img=bac.image; var col=bac.background_color; var rad=bac.radius; } } } } $('#wrapper').css('background-image','url('+img+')','background-repeat','no-repeat'); $('#wrapper').css('background-size','cover'); $('#wrapper').css('background-position','center'); $('#wrapper').css('background-color','#'+col+''); $('#wrapper').css('border-radius',''+rad+'px'); $('#wrapper').css('box-shadow','inset 0 0 400px #ef9201'); });
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Jun 9, 2015 10:39:57 GMT -8
$(document).ready(function(){ var shad=pb.plugin.get('border_around_forum_plugin').settings.bafp.shadow; var bac=pb.plugin.get('border_around_forum_plugin').settings.bafp; for(i=0;i<bac.length;i++) { var theme=bac .theme; console.log(theme); if(theme.length > 0){ for(r=0;r<theme.length;r++){ if(pb.data('user').theme_id==theme[r]){ var img=bac.image; var col=bac.background_color; var rad=bac.radius; } } } } $('#wrapper').css('background-image','url('+img+')','background-repeat','no-repeat'); $('#wrapper').css('background-size','cover'); $('#wrapper').css('background-position','center'); $('#wrapper').css('background-color','#'+col+''); $('#wrapper').css('border-radius',''+rad+'px'); $('#wrapper').css('box-shadow','inset 0 0 400px #ef9201'); }); function togglecheck()
{
check to see if its checked yet then run this if its not
$('#wrapper').css('box-shadow','inset 0 0 400px #ef9201');
else
$("#wrapper").css("box-shadow", "none");
}
it is its own function therefore it would be beneath your document.ready statement outside of all brackets. However the code itself is not in working condition, it's just the basic flow of how it would work if you get a code that will check if the checkbox in the html I provided is checked or not. The code will run when my html box is checked because of the onclick property
|
|