John Borys
John Borys

Reputation: 93

How to remove css files?

I am developing an enterprise application using Spring, Java, JSPs, Tiles, and JQuery. I have several tabs that need a particular css file. Each Tab corresponds to a JSP. The JSP that needs the css file has the css include in it. The problem I have is that once I load a css file needed in tab/jsp Foo, that css file is still active when I click on tab/JSP bar. How do I make sure that when a user clicks on the jQuery tab, that all the css files from the previous tab/jsp are removed? When I hit refresh, the problem disappears, is there a way to refresh automatically?

Upvotes: 0

Views: 336

Answers (2)

Mujtaba Hassan
Mujtaba Hassan

Reputation: 2493

On clicking tab you are just changing the tab. On tab click if you redirect to the current url e.g.

window.location = window.location; //Or put URL like window.location = 'some url here';

and put some logic (may b write a cookie) to select the tab that was clicked.

Upvotes: 0

Mike G
Mike G

Reputation: 758

Simply adjust your CSS targets to be tab specific:

.tab-about h2 {
    /** ... **/
}

.tab-about p {
    /** ... **/
}

.tab-home h2 {
    /** ... **/
}

.tab-home p {
    /** ... **/
}

Upvotes: 8

Related Questions