i am using turn.js (a script that makes a pape flipping effect) to publish my articles online, but i want to add an index with clickable links that jumps to a specific page
I've searched for my question here and the closest one is
Turn.js more controls to make buttons
The answer was:
$("#magazine").turn("page",4) // goto page number 4
Reference: http://www.turnjs.com/#samples/docs/18
Well i don't know where to put it and make it an action for a clickable link
sorry for the novice question i'm a graphics designer and a poet but i'm totally new to javascript coding
Thanks for your time
I don't know turn.js but you can try making a link which calls javascript as follows :
Index term
Make your index a list of such links setting appropriate values for the page number and index term. A quick scan of the documentation showed no reason why this would not work.
Related
I'm trying to add to my Tumblr site an additional page that displays all my posts in a random order. Effectively each time this page is loaded or refreshed the posts would be re-ordered randomly. I really want this functionality for my online art and words project as I want people to be able to discover earlier posts in an easy and fun way. I know tumblr already has an inbuilt "/random" feature but this only displays a single post, rather thank randomly ordering all posts. For reference my site is here.
I struggled with some other answers I found on this site as I'm less confident with how exactly to edit and implement changes to my specific themes javascript as opposed to just simply changing the appearance using html and css.
Any help or tips would be much appreciated,
Thanks
Kyle
You could do a cool trick with jQuery where you load a few posts from the "/random" url and then append them to the current page, using .load().
I tried this by going to "/random" on your page and running the following code. Adds five random posts to the current post list.
for (var i = 0; i < 5; i++) {
jQuery('.init-posts').append(jQuery('<div>').load('/random .init-posts article'));
}
You can apply the same logic to a Custom Page you create so long as it has a template like your single post pages.
I am wondering if someone could give me a brief explanation as to how a site like darebee.com can auto-update its content every day. I understand javascript can be used to create div content through use of arrays but I don't think that is what is going on here.
Im not sure if this is a duplicate question as I have searched for similar question but the answers was not really what I was looking for.
I have a page featuring previews for different sporting results.
Example
Round-1 has 7 fixtures and I will write 7 previews on those fixtures.
Round-2 has 7 fixtures and I will write 7 previews on those fixtures.
you get the point.
The Problem
Now my problem is the page is becoming quite long exceeding 20'000 words plus.
Instead of the user having to scroll to the bottom of the page for the latest round, I would like to add the rounds to the top of the page where the user can just click the desired round and it will automatically scroll to the div containing that specific round.
Im sure this can be easily done but I am a complete novice when it comes to Javascript.
if anyone can give me a bit of advice, or point me in the right direction it would be greatly appreciated.
You don't need javascript for this, in HTML you can link to the id of the fixture. Something like:
link to fixture1
more content...
<div id="fixture1">Something here</div>
Please try searching the site first for answers that already exist
How to scroll to specific item using jQuery?
You can also just use html using anchors and the id attribute on your rounds.
go to round 1
<div id="round1"></div>
You can do this using following code. List your headings of round at the top of the page using anchor tag. Like this
Round1
Here round1 is Id of div for your actual round description.
And then..
<div id="round1">actual round description</div>
This will achieve your requirement.
Basically this is the first time when i ASK A QUESTION on stackoverflow. Anyway i will really appreciate if someone can point me to some direction about creating an simple product catalog app using html5+xml+js.
Well the structure is the following:
A: Home page >click> Product Categ >click> List of Products >click> Product Page Description
I'm not sure how shall i create the dynamic pages for the products to be able to extract all the products description from XML whenever click on any of product from the list page.
For example i have 10 products on the page, when i click on product X, an dynamic page with the product X 's (image, description, price) to be created, and so on.
I hope all of these things make sense for you and thanks a lot for your precious time.
For reading XML files using JavaScript, check answers from this question. For HTML5 and JavaScript in general I suggest you to check tutorials for some basics:
JavaScript - http://www.w3schools.com/js/default.asp
HTML5 - http://www.w3schools.com/html/html5_intro.asp
You can also check jQuery library tutorial. And here is jQuery's website.
I think that you should read some basics to learn how to look for more in the web and search for "how-to" connected with specified things you want to do and still don't know where to start.
EDIT:
If you want to check something that you'll need exactly at the beginning, you can check this documentation of addEventListener JavaScript method that will allow you to set action that will be invoked when particular event of the element fires. You can also check links connected to jQuery I mentioned above - jQuery is JavaScript library that makes writing JS simplier. But with both JavaScript and jQuery you have to spend some time reading documentation to know what you can do and how to achieve it.
I hope to create a website simple website with:
Left menu with items to click
When each item clicked, right menu is changed with new content. The content is always: title, picture 1, text description, picture 2. Same format for all left menu items.
Ideally I want the page to be just 1 page, without frame or separate .html files. If the item is clicked, jQuery will change the photos on right side with photo url in some array.
Is there an easy way to create this with existing templates somewhere? Either from internet, Wordpress (without database), Dreamweaver, or Dreamweaver plug-in... I just want to avoid having to do from scratch.
If you imagine this right, it could be just like a help page from MSDN, IBM or Apple Developer website. Just don't want to do each html separately due to potential change in format later.
Thanks.
Basically, each "page" should be placed in a div that is hidden with css. jQuery can show and hide the divs with a variety of effects.
I have created a simple example for you here:
http://jsfiddle.net/RLdmZ/2/
Whilst the exact specifications you require may not exist already, there are other options in jQuery.
Notably, a search for a 'jQuery gallery' returns many options varying in design, implementation and complexity.
Have a look for yourself!
I hope this answer solves your question.
It's my first answer, so go easy! :]