Link to home
Start Free TrialLog in
Avatar of Tom Powers
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

$(document).ready(function() {
   $('#Abutton1').click(function(){
      $('#layer1').show();
   });
   
   $('#Abutton2').click(function(){
      $('#layer1').hide();
   });
});

Open in new window


Don't worry about stats here the goal is to show and hide a layer with a click of a image
matchupver2withsplitstats.html
Avatar of Tom Powers
Tom Powers

ASKER

I know image is not there but if you click you can see the show and hide locally work. But not Public Web page.
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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/ChrisStanyon/X9RQT/ and ask any questions if it doesn't makes sense.
Chris helped me fix my problem with a layer. I appreciate it. Good work!
Yo Chris thanks for the link I'm gonna use   Thanks Bro.
$('#button1').click(function() {
    $('#layer1, #layer2').toggle();
});
Cool. Keeps it simple :)