Tom Powers
asked on
Layer shows and hides locally but not on a public webpage
I created a layer that I want to cover up a section of stats because I have to populate this layer with split stats. Now I got it to work locally but if it's public page it or the image that you click doesn't work any ideas why? I'm using this Real Simple try in locally then here is the public page with same image that I'm using as buttons
http://199.233.14.112/aspdata/mlb2/matchupver2withsplitstats.html
Don't worry about stats here the goal is to show and hide a layer with a click of a image
matchupver2withsplitstats.html
http://199.233.14.112/aspdata/mlb2/matchupver2withsplitstats.html
$(document).ready(function() {
$('#Abutton1').click(function(){
$('#layer1').show();
});
$('#Abutton2').click(function(){
$('#layer1').hide();
});
});
Don't worry about stats here the goal is to show and hide a layer with a click of a image
matchupver2withsplitstats.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Chris I'm still learning should I put #layer1 at top of <body> tag before any html code? Would that be how to go about fixing this problem ?
No, not really. I can't see exactly what you're trying to do, but I would have a table row for the pitchers name and the button, and then one more row containing both sets of stats - call them something easy like layer1 and layer2. Set the CSS of layer2 to display:none; so it can't be seen. Now, the click of your button will need to toggle the display of layer1 and layer2.
Have a look at this code - http://jsfiddle.net/ChrisS tanyon/X9R QT/ and ask any questions if it doesn't makes sense.
Have a look at this code - http://jsfiddle.net/ChrisS
ASKER
Chris helped me fix my problem with a layer. I appreciate it. Good work!
ASKER
Yo Chris thanks for the link I'm gonna use Thanks Bro.
$('#button1').click(functi on() {
$('#layer1, #layer2').toggle();
});
$('#button1').click(functi
$('#layer1, #layer2').toggle();
});
Cool. Keeps it simple :)
ASKER