parallax refreshing the page not taking the page to the landing page - parallax

I am very much new to the scripting languages...
While my queries are mentioned below:
I am working on a parallax website : http://sysconnect.co.in/clematis/
But I want that if the person refreshes the page from the inner page it must bring the page back to the landing page....
I have used the below code on the page but it still not functioning as required...
Since, after refreshing twice then the page moves to the landing page...
Could some one help me to get it right?
jQuery('body').scrollTop(0);
jQuery(window).scrollTop(0);
jQuery('html').scrollTop(0);
window.scrollTo(0,0);

Did you try:
document.getElementById("body").scrollTop = 0;
If this doesn't work, you may want to replace the "body" element id with the id of the container of your parallax section.
If you need parallax-specific scrolling help, my company and I have a list of parallax tutorials at http://potentpages.com/parallax-tutorials/. You will likely want the jQuery section. A tutorial there may be able to help you if the "scrollTop" solution doesn't work.

Related

jQuery Mobile + FullCalendar - need to refresh page to see it with multiple page divs

Please see this jsbin test page that illustrates the issue
I have a simple jqm page with two page divs. The only initialization is being done inside a $(document).on('pageshow', function(){}); block. Inside the block, I initialize a fullcalendar.js calendar.
If I load the page as an external page (the first link in the menu) it loads without a hitch (but it's not using ajax, so the page flickers and there's no transition).
If I load the page using the jqm convention of linking to the id of the second page div with an anchor tag, it loads the calendar div as a page with no data.
If I then refresh the page, the data is displayed. Subsequent use of the menu displays both page divs as pages without issue.
I've seen a lot of discussion about which event of the pagecontainer widget to use, and I'm aware that document.ready() is not the way to go. I've tried all the possibilities, I think (pagebeforeshow, pageshow, pageinit, etc.) There's more detail in the demo, where you can see all the code. If I need to post it here, too, I can do that, but it's easier to see the issue if you load the test at jsbin. I suggest running it in a separate window, so you can refresh the page.
If anyone else has solved this or has an idea what I'm doing wrong, I'd really appreciate the help and / or suggestions.
I put all of the pagecontainer events into my test jsbin code and stepped through them. (Thanks to Gajotres for providing useful documentation on the various pagecontainer hooks). It turns out that the one I needed was 'pagecontainerhide' instead of pageshow, pageinit, or any of the others. Once I modified the code to use that event, the calendar displayed properly on the page div, with transition, and I no longer had to click on refresh to see load the "page".
Since I have all the events there, perhaps others with page change issues can benefit from the test page....

Render 2 views at the same time?

I'm kinda new to rails so forgive if this is a stupid question.
The scenario is:
I got my events controller with a index view that shows all events on the page. Now, what i want to achieve is: User clicks on one of the events, lightbox comes up showing all info about about that one event, with all the other events still behind the dark background of the lightbox. User closes the light box and process repeats. Pinterest is a good example of what i'm trying to do.
At the moment, i got these 2 views working properly. User clicks on the event and is taken to the show action.
So i'm wondering if what i'm trying to do is RESTfully achievable(without too much hacking around) in rails(3.2.8) and if so, would appreciate some insight as to where i should start from.
Thanks a lot.
As far as I understand what you want to achieve, it has nothing to do with actually rendering 2 views at the same time. What you're describing is simply making an ajax call with lightbox that opens up an URL that renders another view in the shown DIV or IFRAME (whatever lightbox uses)...
Depending on which version of Rails you use the implementation of this looks a bit different. But actually what you have to do is simply include LightBox2 in your Rails app, by simply adding the appropriate JS and CSS files and then supply the necessary class at your link_to calls...
Hope it's clear what I mean.
UPDATE
See this link for further info.

Saving state of web page in HTML5 / Phonegap

I've just started making an iPad app using Phonegap.
On one of my pages I access the camera, take a picture, display that picture on the page and then have a number of customisable options (resizing, positioning of other elements that can be dragged on top of the image etc)
Once you click on a different link (tab bar item) however, all of this information is lost and you have to start over once you go back to the photo page. Is there a way to capture the web page in it's current state, or even grab each elements information (position on page, last photo taken etc) individually so that when the user goes back to the next screen, everything loads as it were when the user left the screen.
Hope this makes sense and someone can help! Thanks in advance!
I'm just a beginner Phonegap developer myself, but I believe you probably want to look into localStorage. http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html#localStorage
You'll need to use JavaScript (and perhaps a library like jQuery) to get various data about the page's current state. Once you know them, you should be able to to store them for retrieval in subsequent sessions later via localStorage.
I hope this helps.

RSS app in iOS: Detecting the existence of a feed through UIWebView

I'm making an RSS app.
In my "Add Feed" tab there is a UIWebView covering half of the page. I want to be able to google search or type in a website in my web view. On the other half of the page I want to have any feeds that are detected in the UIWebView to be displayed.
When the feeds/feed URL's are displayed, I want them to be next to a "plus" or "add" button. When clicked the feed is then added/saved to a UITableView in another tab.
I'm not asking anyone to write the code for me, but if anyone knows where to start or if there's a certain class that would help, please let me know! Or even a tutorial that gets me on the right track!
Here's an app that has the feature I'm talking about (the detection part) I just want to display it a different way. http://itunes.apple.com/us/app/free-rss-reader/id290537970?mt=8
Any Help is greatly appreciated. Thanks.
Once loading is complete, fetch the HTML content of the web view:
[webView stringByEvaluatingJavaScriptFromString:#"document.documentElement.outerHTML"];
Use a regex or some other method to parse through the content and extract the href and title attributes of the anchor tags.
Use a heuristic to look for link titles or hrefs containing "rss", "feed", or "xml", which may indicate an RSS link.
Present the filtered list of links to your user.

How to separate menu and content in the same page

I have a list of menu items and content in a single page. In PC browser or ipad, I want to see both parts in the same page. But in the smaller devices such as iphone and android phone, I want to separate the two so that you selects one of menu items in a page and see its content when he clicks it.
Jquery mobile demo page already does it. But I can't figure out how I can achieve it. Can someone explain or point to any good reference? Thanks
You may take a look at the following blog post which illustrates how you could organize your views so that based on the client type you could provide different contents.

Resources