jquery - Modify more than 1 css file with javascript -
i'm trying find way modify css while html running, far find possible little script next...
$("button").click(function(){ $("p").css("color","red"); });
as can concern effective way modify local css stylesheet refered our html while webpage running (i.e. pushing div button).
what i'm trying modify specific .class css stylesheet of jquery plugin replacing standard right-click context menu.
i didn't found way in js call specific stylesheet modify .class or #id
so html had following definitions:
<script src="jquery.contextmenu.js"></script> <link rel="stylesheet" href="jquery.contextmenu.css"> <link rel="stylesheet" href="localstyle.css">
but when try update custom jquery css script this
$('#red').click(function(){ $('.contextmenuplugin').css({'background-color': 'white'});
.contextmenuplugin (native in jquery.contextmenu.css) isn't recognized, script work .class or #id own stylesheet (localstyle.css).
i try things using local css embedded in html, , referencing jquery css id still nothing change. there's link of github repo jquery plugin:
https://github.com/joewalnes/jquery-simple-context-menu
i try make live jsfiddle dosn't work @ proyect, if helps or want check it, there's pastebin of issue:
http://pastebin.com/u/27gris (4 files)
i hope me clarify this, thanks in advance, federico.
you should rethink solution. instead, add additional class stylesheet has css changes want.
then, on clicking button can call addclass add appropriate elements.
Comments
Post a Comment