Linking to a specific data target on a separate page - javascript

I've been searching and searching and for some reason I cannot figure this out as simple as it probably is.
I am trying to link a logo from a list on a home page and connect it to the full details related to it on a separate page. The full details on the separate page are in a carousel being controlled by data targets, How can I link the logo from the home page to the specific data target on the full details page?

The best method would be to add a hash for the anchor tag to your url, and then use javascript to read the hash and then scroll to it! Here's a duplicate question with an answer that successfully accomplishes the effect jQuery scroll to ID from different page

If I understand the question, assuming the logo is displayed in an <img> tag, try wrapping an anchor tag around it with an href like so
<img src"myImg.jpg>

Related

How to share a link with image on facebook

I'm trying to make link button that shares the page on facebook, I'm using that url from facebook https://www.facebook.com/sharer/sharer.php?u=. The problem is the page I want to share has a dynamic image, so depending on the parameters in my url the image should be different, for example events.com?id=2, this should bring an image related to event 2 and so on, so I can't put the meta tag on my head. I was trying to add the meta tag after I receive the data from my database using jquery but it doesn't work. any suggestion?
You need to add meta tags to your page. More info in the following documentation

How to retain query parameters alongside anchor links after section change event in fullpage.js?

Whenever I append a query string in the url of a page containing FullPageJS, this querystring is removed on section change event. I want it to be retained even after section is changed. Any help would be appreciated.
Feel free to open an issue for it in the github issues forum.
As far as I can see the only solutions for it at the moment are:
Remove your anchors option from your initialisation to stop using anchors in fullpage.js
Use the query string before any anchor is added to the URL. Try this url for example: https://alvarotrigo.com/fullPage/?demo=aaa

How do I open a link to specific div in cordova application

I'm currently working on a mobile application using Cordova.
When I click on the 'reviews' button on one page, I want it to open up the next page (which shows more about that particular company) and automatically scroll down to the 'reviews' div on that page.
I've tried adding a scrollTop within the onclick function, adding a # to it (this breaks the link completely) and many other different things.
How can I do that? Any help would be greatly appreciated!
***Edit
a onclick="' + showpage + '"
this url is bring created from json info that is being brought in depending on certain criteria.
The page that it is on is a list of businesses, then if you click on the name, it goes to a page about that particular business. Currently when you click on the reviews, it also goes to the particular business but I want it to load the business page then automatically scroll down to the reviews div (This is being created dynamically as the page is loaded).
div class="star-review' <-- this is the div that I'm wanting it to scroll into position to.
Avoid href in a tag....
Use this simple workaround in JavaScript
<a id="scrollToTop name="scrollToTop" value="Send">
Scroll To Top
</a>
<script>
$("#scrollToTop").scrollTop(
$("#scrollToTop")[0].scrollHeight);
});
</script>
The href was being built into a function and then showpage was spitting that link out, I solved the problem by rebuilding the href without showpage and then I was able to add my #reviews to the end of it. :)
Cordova creates application using single page architecture, so it creates a link between page using hastag.
data-role="page" id="mypage"
In your tag you need to pass data-role as page, and you need to pass its id.
When creating link on the page, you need to write link tag as mentioned below:
My Page Link
Thanks
Amit

Best approach to showing multiple html without reloading page

I have a "server" that serves up individual html pages for each associated item in the server. I've done a lot of looking around but I'm afraid I just don't know enough to ask the right question. How I'd like it to work is as follows:
Static Sidebar (boostrap simple-sidebar)
Ordered list of links to associated html docs
When the associated link is pressed to display that content in my main container field.
From what I've read some use iframe in the main html container and make the clicked link the active link.
Others use bootstrap modal, but modals no longer support remote content.
Any hints toward how to ask the right question would be great!

Linking to a page and expanding a topic with Javascript

I want to link to a page which contains multiple support topics.
When the user clicks on the link while being on an external site, the topic should be expanded as soon as the user arrives on the support page.
Example:
I link to this page
http://www.nintendo.de/NOE/de_DE/support/nintendo_ds_lite_159_142.html
Topic I want to be opened on arrival
javascript:fadeNAppearDiv('box_3_9277');
(First topic in the FAQs)
It's not clear if you are maintaining the target site (where the div will open) or not. If you don't have access to the code for that page, then there isn't any way to invoke the javascript function on it. If you can modify that page, you can do as #PhiLho suggests and modify the URL you are using to specify the DIV to open and have an onLoad handler that parses the URL and opens the appropriate DIV.
Good idea, but I don't see the question... :-)
The way I saw on some sites, like deviantART, is to use the sharp anchor notation: myURL.com/foo/page.html#TopicToExpand
JS can analyze the current URL and get the anchor part, then do whatever you need to do to highlight/jump to the right place.

Categories

Resources