Zurück   Flashforum > Alternative Technologien > JavaScript & jQuery

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 08-04-2010, 19:01   #1 (permalink)
pirate
 
Benutzerbild von robert
 
Registriert seit: Nov 2005
Beiträge: 983
Jquery History

Hi leute,
ich hab folgendes Problem. Ich möchte das History Plugin von jQuery benutzen,
aber es will einfahc nicht funktionieren.

Wenn ich den Link klicke, ist der Hash in der adressleiste oben, aber
am content ändert sich nichts. mach ich dann nen reload, funktionierts.


also wird beim seiten laden die funktion "pageload" aufgerufen, aber nicht
beim klick. ich verstehe aber absolut nicht warum. hat jemand ne ahnung?



danke gruß

Code:
// PageLoad function
// This function is called when:
// 1. after calling $.historyInit();
// 2. after calling $.historyLoad();
// 3. after pushing "Go Back" button of a browser
function pageload(hash) {
	// hash doesn't contain the first # character.
	if(hash) {
		// restore ajax loaded state
		alert("LOADING");
		$("#load").load(hash + ".php");
	} else {
		// start page
		$("#load").empty();
	};
};
	
	
$(document).ready(function() {
					$.history.init(pageload);
					
					
					$(".startDiv").hide();
					$(".startDiv2").hide();
					
					$(".startDiv").fadeIn(400);
					setTimeout(function() { $('.startDiv2').fadeIn(400); }, 1900);
					

					$(".menuBt1").hover(
						function(){
						  $(this).animate({ 
						    color: "#FBB03B",  	    
						  }, 20 );
						},
						function() {
							$(this).animate({ 
							 color: "#444444",  	    
							}, 600 );
						});
					
					//clicks
					$("a[@rel='button']").click(function(){
								// 
								var hash = this.href;
								hash = hash.replace(/^.*#/, '');
								// moves to a new page. 
								// pageload is called at once. 
								$.history.load(hash);
								return false;
							});
					
				});
__________________
:: apfeltrip.

:: http://mumedia.net/blog
:: http://mumedia.net
robert ist offline   Mit Zitat antworten
Alt 08-04-2010, 20:03   #2 (permalink)
pirate
 
Benutzerbild von robert
 
Registriert seit: Nov 2005
Beiträge: 983
Ich bin soweit, dass die funktion nun aufgerufen wird.

aber die variable hash ändert sich nicht beim click sondern erst
beim reload der page. das ist irgendwie komisch.


Code:
// PageLoad function
// This function is called when:
// 1. after calling $.historyInit();
// 2. after calling $.historyLoad();
// 3. after pushing "Go Back" button of a browser
function pageload(hash) {
	// hash doesn't contain the first # character.
	if(hash) {
		// restore ajax loaded state
		alert("LOADING" + hash);
		$("#load").load(hash + ".php");
	} else {
		// start page
		alert("startpage" + hash);
		$("#load").empty();
	};
};
	
	
$(document).ready(function() {
					$.history.init(pageload);
					
					
					$(".startDiv").hide();
					$(".startDiv2").hide();
					
					$(".startDiv").fadeIn(400);
					setTimeout(function() { $('.startDiv2').fadeIn(400); }, 1900);
					

					$(".menuBt1").hover(
						function(){
						  $(this).animate({ 
						    color: "#FBB03B",  	    
						  }, 20 );
						},
						function() {
							$(this).animate({ 
							 color: "#444444",  	    
							}, 600 );
						});
					
					//clicks
					$("a[@rel='history']").click(function(){
								// 
								var hash = this.href;
								hash = hash.replace(/^.*#/, '');
								// moves to a new page. 
								// pageload is called at once. 
								$.history.load(hash);
								alert("klicked");
								return false;
							});
					
				});
__________________
:: apfeltrip.

:: http://mumedia.net/blog
:: http://mumedia.net
robert ist offline   Mit Zitat antworten
Alt 08-04-2010, 20:44   #3 (permalink)
pirate
 
Benutzerbild von robert
 
Registriert seit: Nov 2005
Beiträge: 983
Code:
$("a[@rel='history']").click

Das wollte er irgendwie nicht verstehen. Wenn ichs über die Klasse
anspreche gehts.


Problem gelöst!
__________________
:: apfeltrip.

:: http://mumedia.net/blog
:: http://mumedia.net
robert ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[JQuery][JSTree] Nightflyer JavaScript & jQuery 7 07-04-2010 23:10
Jquery und CSS michey HTML und CSS 5 24-03-2010 08:19
[jQuery]Probleme mit IE Nicmare JavaScript & jQuery 11 06-08-2009 07:35
Problem mit jQuery derkrebs JavaScript & jQuery 3 21-04-2008 16:35
[jQuery] Problemchen Nicmare JavaScript & jQuery 1 19-12-2007 12:55


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:09 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele