Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
jQuery Slide
#1
I was wondering what jQuery plugin you were using for the sliding effects are your homepage. I'd love to have that on my site! Cool
Kevin Mark - TheHostingTool Lead Developer
Reply
#2
Its just an combo of $.get() and the slide effect, I know how it works Wink
I don't think that its an plugin.
Jimmie Lin - Community Manager & THT.Next Developer
Reply
#3
Could you show me how it works? I'd really love to use this. Big Grin
Kevin Mark - TheHostingTool Lead Developer
Reply
#4
If Jonny allows me to do so...Get on IRC. I will explain it.
Jimmie Lin - Community Manager & THT.Next Developer
Reply
#5
Sure, you can do that.
Jonny H - THT Main Developer & Founder


Reply
#6
Code:
function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
var page2;
var old;
function page(url) {
old = page2;
if(old == null) {
old = "home";
}
page2 = url;
if(page != old) {
document.getElementById("nav_"+old).setAttribute("class", "none");
$.get(url+".html", function(data) {
document.getElementById("nav_"+page2).setAttribute("class", "active");
if(document.getElementById("content").style.display == "none") {
document.getElementById("content").innerHTML = '<div class="maintxt">'+data+'</div>';
$("#content").slideDown(1000);
}
else {
$("#content").slideUp(1000, function() {
document.getElementById("content").innerHTML = '<div class="maintxt">'+data+'</div>';
$("#content").slideDown(1000);
});
}
});
}
}
$(window).load(function () {
var urlpage = gup("page");
if(urlpage != "") {
page(urlpage);
}
else {
page('home');
}
});

OK. I got that into the head of my page. But how do I change it to work with my page? Cause, I tried but it didn't work right. Tongue
Kevin Mark - TheHostingTool Lead Developer
Reply
#7
Kevin, that code isn't really general code. It's very specific to the THT website and what it needs. I'd suggest you look at this:
http://docs.jquery.com/Effects/slideTogg...edcallback
Jonny H - THT Main Developer & Founder


Reply
#8
Thanks, Jonny. I'll take a look at that. Big Grin
Kevin Mark - TheHostingTool Lead Developer
Reply
#9
Hmmmmm
Reply
#10
Can you teach me how to use? I really want to use this...



--------------------------------------
dexter seasons 1-5 dvd boxset
the office seasons 1-7
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)