problem with MENU link to frontpage + anchor

Professional Joomla restaurant template comes with a custom animated modules and advanced typography elements.
GK User
Wed Sep 09, 2015 9:07 am
I have problem with menu and linking to FrontPage#anchor.
There is example:
http://www.prirozenesily.cz/index.php?o ... temid=1054
And from this page I need to link to http://www.prirozenesily.cz/#kontakt
There is MENU item "KDE MĚ NAJDETE" (on the right side of top menu under KONTAKT), but this link simply not work when I clicking on it (tested on many browsers). This is propably menu bug.
User avatar
Junior Boarder

teitbite
Fri Sep 11, 2015 10:03 am
Hi

An url to link to is set as "/#kontakt" which means HTML is looking for this anchor in the page You are currently at. If You want this to first move to a different page and than to anchor You need to use a full link "http://www.prirozenesily.cz/#kontakt" with http://www and all this stuff.
User avatar
Moderator

GK User
Fri Sep 11, 2015 10:20 am
Of course, we also tried the whole URL (http://www.prirozenesily.cz/#kontakt) but also does not work - now it is on web full URL, you can try this.
User avatar
Junior Boarder

teitbite
Fri Sep 11, 2015 11:08 am
Hi

Strange thing is that link is not working even when I have it in firebug. Please send me an access to joomla panel, I'll check.
User avatar
Moderator

teitbite
Wed Sep 16, 2015 9:02 am
Hi

Looks like after disabling Smooth Scrolling this works fine. So there needs to be some issue in the code for this feature preventing to use the anchors not present on the page. If You can leave it disabled than fine, but if You want me to fix it than I will need an access to FTP to check code and make some changes.
User avatar
Moderator

GK User
Thu Sep 17, 2015 7:29 am
One interesting thing - from FrontPage link work, from other pages not.
User avatar
Junior Boarder

teitbite
Sat Sep 19, 2015 9:12 am
Hi

I've replaced smooth scrolling script with the one we are already using in Quark family of templates:

Code: Select all
      jQuery('a[href*="#"]').on('click', function (e) {
         e.preventDefault();
         if(this.hash !== '') {
            var target = jQuery(this.hash);
                     if(this.hash !== '' && this.href.replace(this.hash, '') == window.location.href.replace(window.location.hash, '')) {   
               if(target.length && this.hash !== '#') {
                  jQuery('html, body').stop().animate({
                     'scrollTop': target.offset().top
                  }, 1000, 'swing', function () {
                     if(this.hash !== '#') {
                        window.location.hash = target.selector;
                     }
                  });
               } else if(this.hash !== '' && this.href.replace(this.hash, '') !== '') {
                  window.location.href = this.href;
                         }
            } else if(this.hash !== '' && this.href.replace(this.hash, '') !== '') {
               window.location.href = this.href;
                     }
              }
          });


please enable smooth scrolling and make some tests. Please let me know if this makes any difference.
User avatar
Moderator

GK User
Sun Sep 20, 2015 5:40 pm
Hello, now it is working. Thank you very much. Whats now about updating template ? I cannot update, or it will be fixed in new version ?

teitbite wrote:Hi

I've replaced smooth scrolling script with the one we are already using in Quark family of templates:

Code: Select all
      jQuery('a[href*="#"]').on('click', function (e) {
         e.preventDefault();
         if(this.hash !== '') {
            var target = jQuery(this.hash);
                     if(this.hash !== '' && this.href.replace(this.hash, '') == window.location.href.replace(window.location.hash, '')) {   
               if(target.length && this.hash !== '#') {
                  jQuery('html, body').stop().animate({
                     'scrollTop': target.offset().top
                  }, 1000, 'swing', function () {
                     if(this.hash !== '#') {
                        window.location.hash = target.selector;
                     }
                  });
               } else if(this.hash !== '' && this.href.replace(this.hash, '') !== '') {
                  window.location.href = this.href;
                         }
            } else if(this.hash !== '' && this.href.replace(this.hash, '') !== '') {
               window.location.href = this.href;
                     }
              }
          });


please enable smooth scrolling and make some tests. Please let me know if this makes any difference.
User avatar
Junior Boarder

teitbite
Tue Sep 22, 2015 8:03 pm
Hi

This will be included in one of the upcoming updates, but please just in case keep this file separated. I do not know developers schedule, so I cannot say when this update will be available.
User avatar
Moderator

GK User
Tue Sep 22, 2015 8:25 pm
OK, what file has been changed ?

teitbite wrote:Hi

This will be included in one of the upcoming updates, but please just in case keep this file separated. I do not know developers schedule, so I cannot say when this update will be available.
User avatar
Junior Boarder

teitbite
Thu Sep 24, 2015 7:31 pm
Hi

Only one file /js/gk.scripts.js in tempalte folder.
User avatar
Moderator


cron