potter's code :
Quote:
Originally Posted by potter
whateverclass{
position:fixed;
z-index:99999999; /* only needed if you have other positioned elements on the page */
left:0;
bottom:0
}
<div class="whateverclass">HTML HERE</div>
<script>
$('.closeclass').click(function() {
$('.whateverclass').hide();
$('.showclass').show();
});
$('.showclass').click(function() {
$('.whateverclass').show();
$('.showclass').hide();
});
</script>
<a href="" class="closeclass">close</a>
<a href="" class="showclass">show</a>[/code]
|
My code :
Quote:
Originally Posted by me
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<style type="text/css">
.pos_fixed
{
position:fixed;
bottom:0px;
right:0px;
}
</style>
<div id=footer class="pos_fixed" style="width:100%;background-color:darkgreen;border:solid yellow 1px;">
<center>This is the footer that does not scroll. Place any HTML you like here.</center>
</div>
<span id=footerbutton style="position:fixed;right:0px;bottom:0px;backgro und-color:blue;border:solid red 1px;" onClick="footexpand();"></span>
<script type="text/javascript">
var mytog = 0;
var putback = document.getElementById("footer").innerHTML;
document.getElementById("footerbutton").innerHTML = "X";
function footexpand() {
if (mytog == 0) {
document.getElementById("footer").innerHTML = "";
document.getElementById("footerbutton").innerHTML = "^^";
mytog=1;
}
else {
document.getElementById("footer").innerHTML = putback;
document.getElementById("footerbutton").innerHTML = "X";
mytog=0;
}
}
</script>
|
Anyone can copy my code quoted above and it will work with nothing else added.
Try it. Your code cannot be copied into a webpage and work as is and needs a
175k library called jquery to execute. So how are you using "less code"?
You didn't write any code to position the hide/show links.
When the surfer scrolls he'll have to scroll back the other way to click your
hide/show links.
Why are you using anchor tags if the surfer isn't going any fucking where?
Both your hide and show links are visible the whole time.
My hide/show buttons toggle.
You forgot to put your style sheet inside a style tag.
z-index:999999???? Only if you don't know what's on your own web page.
You use the script tag without specifying the script type.
Your code doesn't even work unless you use use the jquery library, but
my code is self contained, freestanding and works in all browsers.
Anybody can use my code without doing anything extra.
You didn't include the code to access jquery in your example :
(<script type="text/javascript" src="jquery.js"></script>)
Also of note is that you say my code is out of date, but my code is exactly the same javascript as what's inside of jquery.
So jquery code is out of date too I guess.
Here is the latest jquery source code : (all 175K of it

)
http://ooaz.com/gfy/jquery-latest.txt



Jquery is for people who need help writing javascript code.
And last but not least, you didn't bother to make a better tutorial, just
sitting there all day trying to pick other people's code apart.
And you failed at that.
My conclusion is that jealousy sucks dude. Get a life.
