Moving the anchor for What we do

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Mar 27, 2014 5:23 pm
Reply with quote
Report this post
Hi,
the anchor - What we do = #gkHeader lead little lower that its should be. How can I fix that? Where can I find the anchor position?

Thanks,
Gorast
User avatar
Platinum Boarder

GK User
Sat Mar 29, 2014 10:43 am
Reply with quote
Report this post
Could You please post an url to your site?
User avatar
Moderator

GK User
Sat Mar 29, 2014 10:54 am
Reply with quote
Report this post
User avatar
Platinum Boarder

GK User
Sat Mar 29, 2014 11:14 am
Reply with quote
Report this post
You have reducet padding of some elements. On creativity there is a stick menu, so when browser moves to correct div it needs to have at least same amount of spacing as the height of the header.
User avatar
Moderator

GK User
Sat Mar 29, 2014 11:15 am
Reply with quote
Report this post
I guessed that was it, but is there a way so work around this and keep my padding?

Thanks,
Gorast
User avatar
Platinum Boarder

GK User
Sat Mar 29, 2014 11:20 am
Reply with quote
Report this post
If you will reduce padding of all elements with the same ammount, you might look int this js:
templates/gk_creativity/js/gk.scripts.js
into section:
Code: Select all
   // SmoothScroll jQUery substitue
   jQuery('a[href^="#"]').click( function (e) {
       e.preventDefault();
       var target = this.hash,
       $target = jQuery(target);
      
       if($target.length) {
          jQuery('html, body').stop().animate({
              'scrollTop': $target.offset().top
          }, 1000, 'swing', function () {
              window.location.hash = target;
          });
       } else {
          window.location.hash = target;
       }
   });


You can offset the point to where the browser scrolls to:
Code: Select all
 'scrollTop': ($target.offset().top - 50)
User avatar
Moderator

GK User
Sat Mar 29, 2014 11:23 am
Reply with quote
Report this post
Thanks! I'll give it a try :D

Gorast
User avatar
Platinum Boarder

GK User
Mon Mar 31, 2014 1:36 am
Reply with quote
Report this post
Cyberek wrote:If you will reduce padding of all elements with the same ammount, you might look int this js:
templates/gk_creativity/js/gk.scripts.js
into section:
Code: Select all
   // SmoothScroll jQUery substitue
   jQuery('a[href^="#"]').click( function (e) {
       e.preventDefault();
       var target = this.hash,
       $target = jQuery(target);
      
       if($target.length) {
          jQuery('html, body').stop().animate({
              'scrollTop': $target.offset().top
          }, 1000, 'swing', function () {
              window.location.hash = target;
          });
       } else {
          window.location.hash = target;
       }
   });


You can offset the point to where the browser scrolls to:
Code: Select all
 'scrollTop': ($target.offset().top - 50)


Hi,
I just tried that. It offset to the spot but after the ease its jumping to the # anchor. Any ideas how to fix this?

Thanks,
Gorast
User avatar
Platinum Boarder

GK User
Mon Mar 31, 2014 12:58 pm
Reply with quote
Report this post
I would need to see it live :(.
User avatar
Moderator

GK User
Mon Mar 31, 2014 1:55 pm
Reply with quote
Report this post
You have the link below. you need backend access?

Gorast
User avatar
Platinum Boarder

GK User
Mon Mar 31, 2014 7:53 pm
Reply with quote
Report this post
But the change you have made is not there. Could you leave it in .js code?
User avatar
Moderator

GK User
Mon Mar 31, 2014 11:19 pm
Reply with quote
Report this post
Hello,

Its there again.

URL: http://gorast.com/HOSTmaster/luxintegra-mk

Thanks,
Gorast
User avatar
Platinum Boarder

GK User
Tue Apr 01, 2014 7:50 pm
Reply with quote
Report this post
You might try to comment out this line:
Code: Select all
window.location.hash = target;

It is just below.

Sadly - this template was not designed to without the paddings.
User avatar
Moderator

GK User
Mon Apr 07, 2014 2:24 pm
Reply with quote
Report this post
Cyberek wrote:You might try to comment out this line:
Code: Select all
window.location.hash = target;



This did the job! :DD

Thanks,
Gorast

ps: Congrats to the new avatar :p
User avatar
Platinum Boarder

GK User
Mon Apr 07, 2014 6:02 pm
Reply with quote
Report this post
Thanks ;).

By the way - please check your site carefully as this change should not damage anything, but this line was there for purpose (yet in your configuration I don't know what would it do), so to be 100% sure that everything works please check all links on the site that links to same page and causes the scroll effect.
User avatar
Moderator

GK User
Mon Apr 07, 2014 9:38 pm
Reply with quote
Report this post
Everything works like a charm for now. All links and modules, components...

I tried to do some modification to be like: window.location.hash = target - 50; but I'm not good in scripting so was easy to remove it :D

If I hit some problems, I'll write here.

Thanks,
Gorast
User avatar
Platinum Boarder

GK User
Tue Apr 08, 2014 4:35 pm
Reply with quote
Report this post
window.location.hash - this code is used to replace link in browser's address bar ;).
User avatar
Moderator


cron