Button click location in "Header : Video background" block

unold's picture
unold
Mon, 04/25/2016 - 05:33
#1
Button click location in "Header : Video background" block

When clicking a button in the "Header : Video background" block, it scrolls down to the next section. I need it scrolling down to a specific ID on the page.

I tried setting the URL to: "<front>#block-webform-client-block-135" - but it keeps scrolling to the same place. Please advise? :)  

phuonght's picture
phuonght
Mon, 04/25/2016 - 06:25

Hi,

Please open file sites/all/themes/md_make/js/application.js, line 128

replace

scrollTop: scrollToElement.offset().top - 60

with

scrollTop: $('#block-webform-client-block-135').offset().top - 60
unold's picture
unold
Mon, 04/25/2016 - 08:20

Thank you for your reply. 

I have multiple sites on the server running the md_make theme, and this only needs to apply for one of these sites.. :) 

Update:
I tried enabling the subtheme, and copied the applicatio.js here, but it does not seem to use this file, it still uses the original application.js file in the main theme?

Update2:
God it working, by adding this to the subtheme template.php. Not sure if it is the best solution?

function md_make_mytheme_preprocess_html(&$vars) {
  //code here if you need custom
  drupal_add_js("/sites/all/themes/md_make_mytheme/js/application.js", array('type' => 'file', 'scope' => 'footer'));
}

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.