by Eraser35 » Fri Jun 05, 2009 3:58 pm
Andy please don't eat me alive. So I've got it working. Thought there are some issues, as expected... I created a <div> to house this sliding garage door (pun intended), so when it is triggered it slides down and takes up 50% of my page, similar to the YourChurch link I posted..This <div> is below my header <div> that houses the entire navigation structure. They butt up right to each other.
1) The sliding animation seems to be very jerky. I've used jQuery before and it's typically very nice and fluid. For this particular script, it starts off sliding down nice and smooth (this takes place for about 10% of the slide, but then makes a quick jump to the end point, almost like the jQuery got tired of sliding and had no patience.)
2) I tried setting a specific navigation button to trigger this slide, i.e. "Settings", which happens to be a an <li>. However, I am having difficulty getting this button to trigger the slide. I tried replacing $(document.body) with $("#settings"), but it does not work.
Current JS
- Code: Select all
$(document).ready(function() {
$(document.body).click(function () {
if ($("#garagedoor").is(":hidden")) {
$("#garagedoor").slideDown("slow");
} else {
$("#garagedoor").hide();
}
});
});
Current CSS for Garage Door
- Code: Select all
#garagedoor {
top: 2.6em;
border-top: 2px groove #888888;
border-bottom: 2px groove #888888;
position: fixed;
width: 100%;
height: 50%;
background-color: #888888;
display: none;
z-index: 5;
}