Tural Ali
Tural Ali

Reputation: 23240

Javascript hashtag navigation

Currently, I'm using following function which works with click event.

$('a.ux-thumb-wrap').click(function(e){
    e.preventDefault();
    href=$(this).attr('href');
    if($(player_container).is(":visible")){
        $(player).tubeplayer('play', href)

    }

    else {
        $(player).tubeplayer({
            width: 853,
            height: 480, 
            allowFullScreen: "true",
            preferredQuality: "large",
            loadSWFObject: false,
            modestbranding: false,
            initialVideo: href,
            autoPlay: true
        });
        player_container.slideDown("slow");
    }

I want to get this result

I didn't work with hashtags before. Please Help me to modify this function.

Upvotes: 1

Views: 7259

Answers (1)

user920041
user920041

Reputation:

Use the jquery hashchange plugin for a lightweigth approach: http://benalman.com/projects/jquery-hashchange-plugin/

Even better in the long run is the backbone.js router: http://documentcloud.github.com/backbone/#Router

Upvotes: 4

Related Questions