How to get jQuery scrollTo plugin to behave within Facebook - javascript

I can't seem to get the scrollTo jQuery plugin to work within my Facebook app. I'm using it to move the window, as I have a form that needs to grow vertically as it is filled out. My code works fine normally, but not in the Facebook environment.
Can anyone explain to me why this doesn't work and if there are generally any special considerations that need to be taken when attempting to move the browser "window" within an iframe?
If there is an alternate solution to the problem that bypasses the use of scrollTo, I'm open to that as well. Thanks!

try this
http://developers.facebook.com/docs/reference/javascript/FB.Canvas.scrollTo/

I think that you will have to integrate your plugin with FB.Canvas.setSize

Related

JQuery Mobile - how to use it for ONLY swipe

I am having huge problems with the jquery mobile pack, it broke my entire page by making links go to ajax and showing the loading div etc. I tried fixing them all and I somehow managed it with tons of excess code (I don't know what part exactly hid the loading part and which part undid the ajax).
Basically JQuery mobile made a mess of my page, and all I need is the swipe event, I found the github repository of jquery mobile (Here), but I honestly have no idea which parts to take so I can use the swipe event.
I know people want code, but there is no problem in my code here, JQuery mobile simply wants to open all links in ajax, and because I am using bootstrap and I don't use JQuery mobile for anything else but swipes, I won't be pasting anything.
If anyone can tell me which parts I need to take/modify to make it work that would be awesome.
I tried by only copying the events/touch.js but it didn't work.
If you want to navigate page without using ajax then you should add tag rel=external
Or data-ajax="false"
you can find more information for Jquery mobile HERE
EDITED
I have Another solution but I pesonally not prefer but I also having same issue before so I tried this solution
$(document).ready(function(){
$("a").click(function (){
window.top.location = $(this).attr("href");
return false;
});
});
Try this I hope its work for you too..
this function will force change document location when user click on any Hyperlink

Edit opened HTML Page, with Javascript

I was looking into making Firefox addons, and I need some help.
Is it possible to edit an HTML page that is open in the browser with javascript?
For example:
User types in "google.com"
Addon is activated
Javascript changes contents of "google.com" to maybe say "Hello!" at the bottom.
Of course this isn't specifically what I want to do, but a push in the right direction on how to accomplish such a task would be great.
~Carpetfizz
From within a Firefox addon this is obviously possible as many extensions do this.
If you, however, simply want to modify the DOM and nothing else than I would recommend taking a look at greasemonkey. Loads of example scripts around to do this: http://userscripts.org/
And the added benefit, if written correctly they also work in Chrome and other browsers.
Yes, it is. You must find a tutorial about javascript DOM manipulation

What is the code behind this javascript?

I'm trying to find out how they were able to create this site. http://www.cpeople.ru, i am trying to build my portfolio to look something like it. Particularly, I want the slider effect of the menu. Please help me out. Thanks. :)
Look at the source code, it's quite open. They're using jQuery with the jCarousel and Mousewheel plugins. On top they have two custom scripts called f.js and portfolio.js, which are plainly readable as is.
Look into free JavaScript frameworks, particularly jQuery UI. jQuery can do plenty of special effects, and it's quite easy to use.
If you look at the source of the linked webpage, you can see it uses jQuery and two jQuery plugins, jCarousel and mousewheel.
Be sure not to copy swathes of code from existing websites (unless it is expressly permitted, as is the case with jQuery), as that would be copyright infringement.
Try chrome sniffer if you use google chrome.

Can javascript capture image download times in the client?

With javascript event timers, you can relatively easily determine how long it too for the page to render in the browser, especially when using tools like Jiffy. However, is it possible to capture more granular events such as individual image/object download times using javascript in the page? I am fairly sure this is not possible, but wanted to confirm with the javascript guru's of SO.
Thank you in advance.
Sadly, unless you load the images using the javascript image object manually instead of in the markup, I don't believe this is possible. that's why you usually see this functionality in things like firefox plugins
You could look at the Net tab in Firebug. I don't know if it can give you same information via Firebug Lite in other browsers or not.
If what you want to time can be put into an event that has a callback, you can check the time before and after. So anything you do with Ajax you can time. What exactly are you trying to time? Can you be more specific?
I'm not totally familiar with this jQuery plugin, but it may be of help to you:
http://plugins.jquery.com/project/timers

PopupWindow in jQuery

I am in need of a popupwindow with the option of a radio button. I have tested with Impromtu. Is any easy made Popupwindow plugin available?
My plugin should work in Internet Explorer, Mozilla and Google Chrome. What would some sample code be?
jqModal is great and easy-to-use for building Modal Popups and the like.
If you want a tutorial on how to build one yourself without jQuery, check out this tutorial.
Check out Thickbox! You can use a div or so on your page as content (see inline content demo).
Here's a list of lightbox like plugins depending on your need:
http://www.fortysomething.ca/mt/etc/archives/006978.php
If you're not absolutely bent on using jQuery, there is another library available that uses the Prototype library that is rather handy. The popup windows are very easy to implement, and the modal dialog boxes are even easier.
On a side note, I have used thickbox before and was rather impressed, but the URL parsing structure that it uses were kind of limiting me for what I needed to do (I was using a ComponentArt object that didn't use anchors).
Anyway, definitely check out this tool. It's probably more than you need, but who knows maybe you'll get inspired to find other uses for it. It's a pretty fun tool:
http://prototype-window.xilinus.com/documentation.html
FaceBox is another option to check out.

Categories

Resources