JS Variable for stylepath

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
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?
 
The best way to do that is to simply switch classes, rather than updating the CSS directly.
 
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;
}
 
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;
}
 
Top Bottom