Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8445801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:45:12+00:00 2026-06-10T09:45:12+00:00

here’s my problem : I created a gallery with Jquery Elastislide Plugin When I

  • 0

here’s my problem :

I created a gallery with Jquery Elastislide Plugin

When I click on a thumb, Hash appears with the picture… But when I refresh/reload the page as a link, Hash doesn’t load with the picture, I want Hash to load the corresponding image.

I tried with some Jquery Plugin like Address, BBQ, History but it doesn’t work.

$(function() {

    $.fn.imagesLoaded       = function( callback ) {
    var $images = this.find('img'),
        len     = $images.length,
        _this   = this,
        blank   = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';


    function triggerCallback() {
        callback.call( _this, $images );
    }

    function imgLoaded() {
        if ( --len <= 0 && this.src !== blank ){
            setTimeout( triggerCallback );
            $images.off( 'load error', imgLoaded );
        }
    }

    if ( !len ) {
        triggerCallback();
    }

    $images.on( 'load error',  imgLoaded ).each( function() {
        // cached images don't fire load sometimes, so we reset src.
        if (this.complete || this.complete === undefined){
            var src = this.src;
            // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
            // data uri bypasses webkit log warning (thx doug jones)
            this.src = blank;
            this.src = src;
        }
    });




    return this;
    };


    // gallery container
    var $rgGallery          = $('#rg-gallery'),
    // carousel container
    $esCarousel         = $rgGallery.find('div.es-carousel-wrapper'),
    // the carousel items
    $items              = $esCarousel.find('ul > li'),
    // total number of items
    itemsCount          = $items.length;



    Gallery             = (function() {
            // index of the current item




        var  current            =  0,


            // mode : carousel || fullview
            mode            = 'carousel',
            // control if one image is being loaded
            anim            = false,
            init            = function() {

                // (not necessary) preloading the images here...
                $items.add('<img src="ajax-loader.gif"/><img src="black.png"/>').imagesLoaded( function() {
                    // add options
                    _addViewModes();

                    // add large image wrapper
                    _addImageWrapper();

                    // show first image
                    _showImage( $items.eq(window.location.hash));

                });

                // initialize the carousel
                if( mode === 'carousel' )
                    _initCarousel();

            },
            _initCarousel   = function() {

                // we are using the elastislide plugin:
                // http://tympanus.net/codrops/2011/09/12/elastislide-responsive-carousel/
                $esCarousel.show().elastislide({
                    imageW  : 65,
                    onClick : function( $item ) {
                        if( anim ) return false;
                        anim    = true;
                        // on click show image
                        _showImage($item);
                        // change current
                        current = $item.index(location.hash);
                        that.attr('href')

                    }
                });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:45:14+00:00Added an answer on June 10, 2026 at 9:45 am

    So if there is a hash, we want to pass the information to the elastislide when the page loads.

    var imageIndex = 0; 
    if (window.location.hash) {
        var imageIndexStr = window.location.hash.replace('#',''); // remove #
        imageIndex = parseInt(imageIndexStr, 10); // convert to int
    }
    $esCarousel.show().elastislide({
        current : imageIndex,
        [rest of elastislide setup as above]
    });
    

    I am assuming here that the hash consists of the index of the image, e.g. #3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it
Here is my problem : I have a post controller with the action create.
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the
Here is a simple timepicker to jQuery UI's datepicker <script type=text/javascript> /* <![CDATA[ */
Here is the problem that I am trying to solve. I have two folders
Here is another spoj problem that asks how to find the number of distinct
Here's a problem I ran into recently. I have attributes strings of the form
Here's a coding problem for those that like this kind of thing. Let's see
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.