• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

JS Variable for stylepath

R

ragtek

Guest
#1
I want to manipulate the css attribute in my js code.

I'm having this in my code:
Code:
                        $switchButton.css('background-image','url(styles/default/xenforo/widgets/togglesidebar_l.png)');
The problem is, that the stylepaths is hardcoded.

In vBulletin it was possible to use IMGDIR_MISC for this, because the variable was initialized by vBulletin.

I couldn't find anything similar in the xenforo sourcecode.
Is there also a variable in XF availabe or do i need to create this myself?
 
R

ragtek

Guest
#3
HM, i don't wanted to make this, because it would be IMHO unnecessary c&p code

Or can i shorten this to something clean? (Sadly I have no clue of css ATM :()
Code:
.breadcrumb .switchside_r
{
height: 13px;
width: 13px;
background: transparent url('@imagePath/xenforo/widgets/togglesidebar_r.png') no-repeat;
margin: 5px;
overflow:hidden;
white-space: nowrap;
display: block;
float:right;
}

.breadcrumb .switchside_l
{
height: 13px;
width: 13px;
background: transparent url('@imagePath/xenforo/widgets/togglesidebar_l.png') no-repeat;
margin: 5px;
overflow:hidden;
white-space: nowrap;
display: block;
float:right;
}
 

Mike

XenForo developer
Staff member
#4
Code:
.breadcrumb .switchside_r,
.breadcrumb .switchside_l
{
	height: 13px;
	width: 13px;
	background: transparent url('@imagePath/xenforo/widgets/togglesidebar_r.png') no-repeat;
	margin: 5px;
	overflow:hidden;
	white-space: nowrap;
	display: block;
	float:right;
}

.breadcrumb .switchside_l
{
	background: transparent url('@imagePath/xenforo/widgets/togglesidebar_l.png') no-repeat;
}