jquery - javascript syntax for class issue -
ok have javascript...
$(document).ready(function() { $('#holder').toggleclass("visible"); $('a.link').click(function(event) { // over-rides link event.preventdefault(); // sets new destination href of link newlocation = this.href; color = $(this).data("color"); $('body').css('background-color', color ); $('#holder').css('opacity','0' ); // delays action window.settimeout(function() { // redirects new destination window.location = newlocation; }, 250); }); $('h1').click(function(event) { $('#holder').toggleclass("visible"); }); });
and have html .......
<body class="landingpage"> <h1 class="begining">page tansitions</h1> <p><a class="link" href="/one.html" data-color="#f36c20">page one</a></p> <p><a class="link" href="/two.html" data-color="#edcd40">page two</a></p> </body>
... that's fine , dandy , js thing , changes color of page ref 'body' in code above....
i don't want change 'body' tag of html page want change class .metro .tile-area-darkcrimson referenced in css , in html... can't life of me figure out how present in javascript can please help.
cheers, greg.
.... further have attempted integrate more complex structure doesn't seem work ... have link html using tile class , animation work without changes.....
<a class="tile double bg-tile1color live animated flipinx link" data-color="#f36c20" data-role="live-tile" data-effect="slideup" data-click="transform">
i using javascript trigger when user clicks on tile , want slot in aforementioned javascript changes page color..i guessing javascript overiding transition....
<script> $('.tile').on('click', function () { $(".tile").addclass("flipoutx"); settimeout(function(){ $(".tile-group.main").css({ marginleft:"-40px", width: "1080px"}).load("musability-musictherapy-company-overview.html"); }, 2000); }); </script>
using jquery can use full css selection methods
$('body').css('background-color', color );
can this
$('.metro .tile-area-darkcrimson').css('background-color', color );
Comments
Post a Comment