Menu icon Foundation

Designer | Munich, Germany

My Posts


My Comments

Tassilo Eichler commented on Tassilo Eichler's post almost 2 years

now it works, a friend helped me:
on the detail page:
http://www.tassiloeichler.de/alex/detail.php?slide=2
I added this java-script:
 
  function getUrlVars() {
        var vars = [], hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
      }
 
    window.onload = function () {
        var active = parseInt(getUrlVars().slide)+1;
        $('li.is-active.orbit-slide').removeClass('is-active').hide();
        $([data-orbit-slide=${active}]).addClass('is-active').show();
    }
 
and on the index page
http://www.tassiloeichler.de/alex/
i set the numbers of the slides without the starting "0".
 
<ul id="container" class="small-block-grid-1 medium-block-grid-2 large-block-grid-3">
      <li>
        <a data-orbit-link="1" href="detail.php"><img src="img/01.jpg"></a>
      </li>
      <li>
        <a data-orbit-link="2" href="detail.php?slide=1"><img src="img/02.jpg"></a>
      </li>
      <li>
        <a data-orbit-link="3" href="detail.php?slide=2"><img src="img/03.jpg"></a>
      </li>
...
 
</u>
 
Enjoy, best
Tassilo
 

Posts Followed

No Content

Following

    No Content

Followers

My Posts

My Comments

You commented on Tassilo Eichler's post almost 2 years

now it works, a friend helped me:
on the detail page:
http://www.tassiloeichler.de/alex/detail.php?slide=2
I added this java-script:
 
  function getUrlVars() {
        var vars = [], hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
      }
 
    window.onload = function () {
        var active = parseInt(getUrlVars().slide)+1;
        $('li.is-active.orbit-slide').removeClass('is-active').hide();
        $([data-orbit-slide=${active}]).addClass('is-active').show();
    }
 
and on the index page
http://www.tassiloeichler.de/alex/
i set the numbers of the slides without the starting "0".
 
<ul id="container" class="small-block-grid-1 medium-block-grid-2 large-block-grid-3">
      <li>
        <a data-orbit-link="1" href="detail.php"><img src="img/01.jpg"></a>
      </li>
      <li>
        <a data-orbit-link="2" href="detail.php?slide=1"><img src="img/02.jpg"></a>
      </li>
      <li>
        <a data-orbit-link="3" href="detail.php?slide=2"><img src="img/03.jpg"></a>
      </li>
...
 
</u>
 
Enjoy, best
Tassilo
 

Posts Followed

No Content

Following

  • No Content

Followers

  • No Content