Call JavaScript from external link - javascript

I am trying to create a horizontal parallax site. Everything is working nicely, when I click the menu the slides move swiftly to the horizontal direction and the corresponding slide is displayed.
I have an external HTML page, that has the same structure as the main site and the problem is that when I click this page's menu, it goes to the site but lands on the first slide.
I want a script so that when I click on this external HTML page link, the page should land on the site, but then it should slide to the corresponding slide.
Main menu link looks like this:
<a onclick="HORIZONTAL.ANIM.instance.move(3);" id="sec4" href="javascript:void(0);">About Us</a>
I want to click on About Us link on external page and then it should land on the main site and then the above script should run and slide should move.

First refer user to new page ( for example http://newpage.com" )with slide id in hash.
About Us
in that new page create a script after page loads that slides to specified slide passed.
window.onload = function() {
var id = window.location.hash.substr(1);//get id from url after hash
HORIZONTAL.ANIM.instance.move(id);
};

Related

Creating a link to a javascript function

I'd like to link to a specific button that is activated with js.
Here is the page
Right now the "Base Vessel" image collection (bottom of page) is displayed when opening the page.
I want to be able to display directly "Fitness center" image collection instead whith my link and also scroll down.
Is this possible to code this in a link?

Manipulating page bookmark position

I'm using Bootstrap to create a single page portfolio, I'm using bookmark links to navigate the page, however I want the page to land earlier than the position it lands on, I am pointing to the div I assigned the Id to it. is there anyway to do it?
Let's say, you want to go to footer on click of Goto Footer link
Goto Footer
Then, the footer block should have
<div id="footer-block">Page Footer</div>

I am hyperlinking a page with specific section

In a wordpress site when the user one clicks on a link, the user will be redirected to the next page where a specific anchor name is hard coded so the user will land on that section.
I am working on a wordpress default script that scrolls to top.
I would like to stop scrolling when a user lands on the page with an anchor name.
http://example.com/services/ -> scroll to top
http://example.com/services/#digital -> do not scroll to top

AnythingSlider - link to a certain image in the slider from a different page

I'm using AnythingSlider jQuery plugin for my gallery. What I try to do is - create a link and "link" it to a specific slide on another page's slider.
For example, the link I have on the page gallery.php is:
And my slider itself is on the page photo.php and it does contain that image in one of its slides. I need to show that specific image first in the slider on the page photo.php when it loads.
Does anybody have any clue on how can this be achieved?
Thanks.
Anything slider has this functionality built-in. It updates the URL hash with the current slideshow and slide when you click one of the navigation tabs.
Here is a link to an AnythingSlider demo page, notice when you click on a tab to change the slide that the URL hash changes: http://css-tricks.com/examples/AnythingSlider/
To link to the fourth slide on the first slideshow on the page you would add this to the URL:
#panel1-4
This option is turned-on by default with the hashTags option set to true.

figuring out this Javascript code

I am trying to figure out how the get the featured area
at http://blueoceanportfolios.com to link to webpages rather than displaying it within the featured box on the left .
This area is using JS file to display the videos on content in the featured box when different items on the menu are clicked, here is the working example :
http://www.blueoceanportfolios.com/company/
Okay ,
The problem: Loading a new webpage rather than displaying the content at featured box at the homepage of above website
Tried solutions: linking to javascript functions like onclick="window.location="http://someplace.com";" etc but still the content loads up in the featured box ,
try clicking on 2) it displays stackoverflow.com rather than loading new page.
Any suggestions ?
This:
<script type="text/javascript">
onclick="window.location="http://someplace.com";"
</script>
... is not the way to add event handlers to an element. If you want those anchors to link to a web page, put the URL in the href attribute like any normal link:
Link text

Categories