SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    URL hash attribute triggering action

    Hi all,

    I am currently learning jQuery and am setting up a site which sells T-Shirts. The products page lists the same T-Shirt in 3 colours:

    iMMAculate HTML Prototype / 10.05.11 / Product 1

    When the user clicks on one of the colours, e.g. Charcoal, the page loads with the hashtag on the end #Charcoal, so:

    iMMAculate HTML Prototype / 10.05.11 / Product 1

    Currently I have the page set up so when the user clicks on one of the colour swatches, it loads the images and the colour name onto the page. However, what I would ideally like to have is for the page to load the relevant colour images and h2 span (colour name) that is generated in the URL sorry does that make sense?

    Would really appreciate any help you can offer, perhaps someone could point me in the right direction.

    Many thanks
    Simon

  2. #2
    SitePoint Enthusiast Anthony.Barnes's Avatar
    Join Date
    Aug 2011
    Location
    Canberra, Australia
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We use this plugin:
    jQuery BBQ: Back Button & Query Library

    It provides some nice wrappers around getting/setting hashes and also a cross browser onhashchange event and history.

  3. #3
    SitePoint Evangelist Sikwondo's Avatar
    Join Date
    Sep 2005
    Posts
    426
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anthony.Barnes View Post
    We use this plugin:
    jQuery BBQ: Back Button & Query Library

    It provides some nice wrappers around getting/setting hashes and also a cross browser onhashchange event and history.
    Thanks Anthony. Have had a read through, that all looks a bit complex to me, I'm not sure where to start :S


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •