How to change Css class using jQuery?

I have a multi-user application with basic layouts where I want to change the layout and page style for an individual user.

I mean, to change css at runtime, but if I change css, then it will act for each user, and if I refresh the page, then it will display the main page again.

Help me in this problem that if I change css then it will take effect only for the same user. and it will not change after the update.

Or any buddy has another idea, please suggest me.

+4
source share
4 answers
$("div#somediv").addClass("specialuserclass"); 

jQuery link or stylesheet for each user;

+2
source

You may be interested in doing this with themes and a plugin for the theme manager that I built. The plugin is built to work with jQuery UI themes, but can be easily adapted to your own CSS-based themes. This plugin works with individual user settings for a specific topic stored in the database, although I suppose you can also use a cookie. the latter will take longer. You can find more information on my blog, http://farm-fresh-code.blogspot.com .

+1
source

You need to keep the style selected by each user.

Your design / design can be designed as follows: 1. After creating a new user, give the user a basic default layout and save it on the server side (perhaps you can save user preferences in your database). 2. When it changes the style, update the user user's preferences record / file 3. When loading the page, extract the user preference and change the css style on the server side.

0
source

If you want to implement this yourself, save your custom styles in a dedicated storage, such as a user-indexed database. At the stage of building the page (on the server side), consult your database, view the settings for this user and apply the CSS that you want on this page.

Alternatively, many thematic applications are available. They will depend on your server tools. For example, ASP.NET offers a web part framework.

0
source

All Articles