Ok I have this javascript...
$(document).ready(function() {
$('#holder').toggleClass("visible");
$('a.link').click(function(event) {
// Over-rides the link
event.preventDefault();
// Sets the new destination to the href of the link
newLocation = this.href;
color = $(this).data("color");
$('body').css('background-color', color );
$('#holder').css('opacity','0' );
// Delays action
window.setTimeout(function() {
// Redirects to new destination
window.location = newLocation;
}, 250);
});
$('h1').click(function(event) {
$('#holder').toggleClass("visible");
});
});
and I have this 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 all fine and dandy and the js does its thing and changes the color of the page which is ref 'body' in the code above....
I don't want to change the 'body' tag of a html page I want to change a class something like .metro .tile-area-darkCrimson as referenced in my css and in my html... I can't for the life of me figure out how to present it in javascript can someone please help.
Cheers, Greg.
.... Further to that I have attempted to integrate it into a more complex structure that now doesn't seem to work ... I have link for the html where I am using a tile class and animation that do work without any 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 am also using a javascript trigger when the user clicks on this tile and that is where I want to slot in the aforementioned javascript that changes the page color..I am guessing the javascript is overiding the 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>