Giter VIP home page Giter VIP logo

Comments (7)

vodkabears avatar vodkabears commented on July 24, 2024

You use hash tracking, you just call it without hash =). Write this to disable it:

<div class="remodal" id="modal_test" data-remodal-id="test"
     data-remodal-options='{ "hashTracking": false }'>
    <!-- load dynamic content --> 
</div>

The page scrolls back to the top, because of the native behavior of any browser. Your link has an id attribute 'test', when the hash changes to '#test', it scrolls back to the anchor with a 'test' id. By the way, it is the reason, why i've added 'data-remodal-id' instead of 'id' attribute.

from remodal.

vodkabears avatar vodkabears commented on July 24, 2024

But yes, thanks, i've tested it, it has a wrong behavior. I found that a page scrolls to the top, when closing modal, i've broken something. I will fix it soon.

from remodal.

mweterings avatar mweterings commented on July 24, 2024

Thanks for your fast response appreciate it, really like your plugin!

Already had disabled the hashtracking in de remodal.js file. And now using rel instead of id but still when opening the modal it scrolls back to the top not just when closing the modal.

from remodal.

vodkabears avatar vodkabears commented on July 24, 2024

OK, will be fixed.

from remodal.

carlos1162 avatar carlos1162 commented on July 24, 2024

In the script there is a piece of code that goes like this at the very end of this script (location.hash = "";) just add "id" in between the quotes, and it will save the current scroll position so it looks like this:
/**
* Close modal window
*/
Remodal.prototype.close = function () {
// check if animation is complete
if (this.busy) {
return;
}
this.busy = true;

    this.modal.trigger("close");

    if (this.settings.hashTracking &&
        this.modal.attr("data-" + pluginName + "-id") === location.hash.substr(1)) {
        // save current scroll position
        location.hash = "id";
    }

from remodal.

mweterings avatar mweterings commented on July 24, 2024

Thanks for your tip but it doesn't seem to work it just puts #id at the end of the url instead of #
i'm using the script on this website: http://stabstudio.com

from remodal.

vodkabears avatar vodkabears commented on July 24, 2024

Download: https://github.com/VodkaBears/Remodal/releases/tag/0.1.3

from remodal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.