jQuery Plugins » page https://jqueryplugins.info jQuery plugins, tutorials and resources Wed, 19 Oct 2011 12:14:58 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 Handle jquery event of one page to another page https://jqueryplugins.info/2011/10/handle-jquery-event-of-one-page-to-another-page/ https://jqueryplugins.info/2011/10/handle-jquery-event-of-one-page-to-another-page/#comments Wed, 19 Oct 2011 07:14:18 +0000 Admin https://jqueryplugins.info/2011/10/handle-jquery-event-of-one-page-to-another-page/ Post link: Handle jquery event of one page to another page

I am using jquery to opening a lightbox.I am using two pages for it(Because my requirement is to fetch the lightbox content from another page).Here is my code for fisr...

]]>
Post link: Handle jquery event of one page to another page

I am using jquery to opening a lightbox.I am using two pages for it(Because my requirement is
to fetch the lightbox content from another page).Here is my code for fisr page on which i have written the code for opening the lightbox

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script>
$  (document).ready(function(){
    $  ('#open').click(function(){
    $  ("#light").load("light.html");
        $  ('div.white_content').css("display","block");

    });
    $  ('#close').click(function(){
        $  ('div.white_content').css("display","none");
    });
});
</script>

<style>
.white_content {
    display: none;
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    padding: 16px;
    border: 16px solid orange;
    background-color: white;
    z-index:1002;
    overflow: auto;
}
</style>
</head>

<body>
    <p>This is the main content. To display a lightbox click <a href = "javascript:void(0)" id="open">here</a></p>
    <div id="light" class="white_content"></div>
</body>
</html>

And here is My Code Where the content for lightbox is

the page in light.html

<div>Hello this is sandeep<br />
        Widevision technology
 <br />indore <a href = "javascript:void(0)" id="close">Close</a>
</div>

The above code is Working fine though.The problem is in closing the lightbox.Since i have fetch the lightbox content from another page(light.html).My close event code is as you can see above written on index.html

$  ('#close').click(function(){
        $  ('div.white_content').css("display","none");
    });

The above code is not working but if i move above code to light.html ,it will work.But i want to make it work from index.html.AS the open event is working from this page why not close event?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/handle-jquery-event-of-one-page-to-another-page/feed/ 0
jQuery UI – Style Delay on Page Load https://jqueryplugins.info/2011/10/jquery-ui-style-delay-on-page-load/ https://jqueryplugins.info/2011/10/jquery-ui-style-delay-on-page-load/#comments Tue, 18 Oct 2011 21:13:55 +0000 Admin https://jqueryplugins.info/2011/10/jquery-ui-style-delay-on-page-load/ Post link: jQuery UI – Style Delay on Page Load

I’m using the jQuery UI tabs widget to style my page: <div id="tabs"> <ul> <li><a href="#tab-1">Tab 1</a></li> <li><a href="#tab-2">Tab 2</a></li> </ul> <div id="tab-1"> ... </div> <div id="tab-2"> ... </div> </div>...

]]>
Post link: jQuery UI – Style Delay on Page Load

I’m using the jQuery UI tabs widget to style my page:

<div id="tabs">
    <ul>
        <li><a href="#tab-1">Tab 1</a></li>
        <li><a href="#tab-2">Tab 2</a></li>
    </ul>

    <div id="tab-1">
       ...
    </div>

    <div id="tab-2">
       ...
    </div>
</div>

<script type="text/javascript">
    $  (function() {
        $  ('#tabs').tabs();
    });
</script>

The problem I have is when I first load the page for a brief moment, I see the page unstyled before the jquery tabs function has had a chance to run. What i mean is for less than a second I see an unordered list with links for Tab 1, Tab 2, etc.

Is there a way to get rid of this delay? Should I add the classes to my markup that jQuery UI ends up adding in order to get rid of this?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/jquery-ui-style-delay-on-page-load/feed/ 0
Javascript breaking a page in Firefox 3.6 https://jqueryplugins.info/2011/10/javascript-breaking-a-page-in-firefox-3-6/ https://jqueryplugins.info/2011/10/javascript-breaking-a-page-in-firefox-3-6/#comments Tue, 18 Oct 2011 20:13:47 +0000 Admin https://jqueryplugins.info/2011/10/javascript-breaking-a-page-in-firefox-3-6/ Post link: Javascript breaking a page in Firefox 3.6

I’m using the jCarousel Lite jQuery plugin on a page, but it seems to be causing severe problems in Firefox 3.6. In that browser, the page briefly loads, and then...

]]>
Post link: Javascript breaking a page in Firefox 3.6

I’m using the jCarousel Lite jQuery plugin on a page, but it seems to be causing severe problems in Firefox 3.6. In that browser, the page briefly loads, and then all of the content disappears, except for one of the <li> elements that I’m using the plugin on.

The page in question is here. The code applying the carousel:

<script type="text/javascript">
    jQuery(window).load(function(){
jQuery(".loopnetcarousel").jCarouselLite({
    btnNext: ".next",
    btnPrev: ".prev"
});});</script>

(I was initially using (document).ready, but replaced that with (window).load after seeing that some people have problems with it in Firefox 3.6, but that didn’t seem to change anything).

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/javascript-breaking-a-page-in-firefox-3-6/feed/ 0
How to select a single text element on a page with multiple forms using JQuery https://jqueryplugins.info/2011/10/how-to-select-a-single-text-element-on-a-page-with-multiple-forms-using-jquery/ https://jqueryplugins.info/2011/10/how-to-select-a-single-text-element-on-a-page-with-multiple-forms-using-jquery/#comments Mon, 17 Oct 2011 22:13:43 +0000 Admin https://jqueryplugins.info/2011/10/how-to-select-a-single-text-element-on-a-page-with-multiple-forms-using-jquery/ Post link: How to select a single text element on a page with multiple forms using JQuery

I have a page with multiple comment boxes. When someone clicks the submit button for the comment box JQuery handles the submission and posts the comment. I then want to...

]]>
Post link: How to select a single text element on a page with multiple forms using JQuery

I have a page with multiple comment boxes. When someone clicks the submit button for the comment box JQuery handles the submission and posts the comment. I then want to set the text in the comment box back to empty. I’m using something like this:

$  ('.formstyle').submit(function() {
    $  .post("/messages/", $  (this).serialize());
    return false;
});

I know there is the .reset() option but that still doesn’t tell me how to access a single text element among many. I can use $ (":input[name=new_message]").val(''); to set the text of all the text boxes on the page but that could be annoying if someone has an message they haven’t submitted. I would think something along the lines of this.(":input[name=new_message]").val(''); would work but no dice. I think I’m just not connecting the dots between this (or more likely $ (this)) and the input selector.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/how-to-select-a-single-text-element-on-a-page-with-multiple-forms-using-jquery/feed/ 0
Is it possible to add JavaScript after page load and execute it https://jqueryplugins.info/2011/10/is-it-possible-to-add-javascript-after-page-load-and-execute-it/ https://jqueryplugins.info/2011/10/is-it-possible-to-add-javascript-after-page-load-and-execute-it/#comments Sat, 15 Oct 2011 11:13:27 +0000 Admin https://jqueryplugins.info/2011/10/is-it-possible-to-add-javascript-after-page-load-and-execute-it/ Post link: Is it possible to add JavaScript after page load and execute it

Say I have a JavaScript function that is inserted into the page after page load how can I then call that function. For example lets keep things simple. Say I...

]]>
Post link: Is it possible to add JavaScript after page load and execute it

Say I have a JavaScript function that is inserted into the page after page load how can I then call that function. For example lets keep things simple. Say I make an Ajax call to get the markup of the script and the following is returned:

<script type="text/javascript">
function do_something() {
    alert("hello world");
}
</script>

If I then add this markup to the DOM can I call do_something() later?

I’m use the jQuery JavaScript framework.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/is-it-possible-to-add-javascript-after-page-load-and-execute-it/feed/ 0
run javascript after everytime page is loaded https://jqueryplugins.info/2011/10/run-javascript-after-everytime-page-is-loaded/ https://jqueryplugins.info/2011/10/run-javascript-after-everytime-page-is-loaded/#comments Fri, 14 Oct 2011 10:17:05 +0000 Admin https://jqueryplugins.info/2011/10/run-javascript-after-everytime-page-is-loaded/ Post link: run javascript after everytime page is loaded

I have a simple question but its haunting me since many days and i couldnt find the solution. I would like to fire a javascript event for everytime the page...

]]>
Post link: run javascript after everytime page is loaded

I have a simple question but its haunting me since many days and i couldnt find the solution.
I would like to fire a javascript event for everytime the page is loaded or rendered.

can any body please help.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/run-javascript-after-everytime-page-is-loaded/feed/ 0
Juqery UI Dialog get parent page element value https://jqueryplugins.info/2011/10/juqery-ui-dialog-get-parent-page-element-value/ https://jqueryplugins.info/2011/10/juqery-ui-dialog-get-parent-page-element-value/#comments Wed, 12 Oct 2011 22:15:02 +0000 Admin https://jqueryplugins.info/2011/10/juqery-ui-dialog-get-parent-page-element-value/ Post link: Juqery UI Dialog get parent page element value

Please see this example http://jqueryui.com/demos/dialog/#modal-form When click “Create new user”, can I get parent page’s element val (like input value) in the dialog? I tired to get value in dialog...

]]>
Post link: Juqery UI Dialog get parent page element value

Please see this example http://jqueryui.com/demos/dialog/#modal-form

When click “Create new user”, can I get parent page’s element val (like input value) in the dialog?

I tired to get value in dialog but always get not defined result.

 fvalue = $  ( "#iv" ).val(); // #iv is a input box in parent page.

Thanks!

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/juqery-ui-dialog-get-parent-page-element-value/feed/ 0
Sticky footer (jQuery) won’t align to bottom of page exactly https://jqueryplugins.info/2011/10/sticky-footer-jquery-wont-align-to-bottom-of-page-exactly/ https://jqueryplugins.info/2011/10/sticky-footer-jquery-wont-align-to-bottom-of-page-exactly/#comments Wed, 12 Oct 2011 03:13:12 +0000 Admin https://jqueryplugins.info/2011/10/sticky-footer-jquery-wont-align-to-bottom-of-page-exactly/ Post link: Sticky footer (jQuery) won’t align to bottom of page exactly

The problem: I’m using jQuery to align my footer to the bottom of a page. It works in FF but IE, Chrome and Safari push the footer down by about...

]]>
Post link: Sticky footer (jQuery) won’t align to bottom of page exactly

The problem:

I’m using jQuery to align my footer to the bottom of a page. It works in FF but IE, Chrome and Safari push the footer down by about 50-100px.

See for yourself:

Look at the footer of www.directsponsor.org to see a live example of the problem.

The code:

<script type="text/javascript">

    jQuery.noConflict();

    jQuery(document).ready(function($  ){
        matchHeight();
    function matchHeight() {
        var mainHeight = $  ("#wrapper").outerHeight() - $  ("#header").outerHeight() - $  ("#leader").outerHeight() - $  ("#footer").outerHeight() - parseInt($  ("#footer").css("margin-top")) - 1 - parseInt($  ("#main").css("padding-top"))- parseInt($  ("#main").css("padding-bottom"));
        var mainReal = $  ("#main").outerHeight(true);

        if ((mainHeight + 1 + parseInt($  ("#main").css("padding-top")) + parseInt($  ("#main").css("padding-bottom"))) > mainReal) {
            $  ('#main').height(mainHeight);
        }
    }
    $  (window).resize(matchHeight);
});

</script>

My question:

What’s causing the footer to sink below the bottom of the page?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/sticky-footer-jquery-wont-align-to-bottom-of-page-exactly/feed/ 0
fully load new page before displaying https://jqueryplugins.info/2011/10/fully-load-new-page-before-displaying/ https://jqueryplugins.info/2011/10/fully-load-new-page-before-displaying/#comments Tue, 11 Oct 2011 13:15:14 +0000 Admin https://jqueryplugins.info/2011/10/fully-load-new-page-before-displaying/ Post link: fully load new page before displaying

I have a mobile site that has a link to another website. The other website can take a few seconds to load so instead of having the user see a...

]]>
Post link: fully load new page before displaying

I have a mobile site that has a link to another website. The other website can take a few seconds to load so instead of having the user see a white screen while the other page loads, I want to keep them on my site and show them a message or image while I wait for the other page to load in the background, once it’s complete, I want to then show the new page. How can I do this?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/fully-load-new-page-before-displaying/feed/ 0
Getting a nice transition effect with jquery, php sessions and a page refresh? https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/ https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/#comments Fri, 07 Oct 2011 01:13:59 +0000 Admin https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/ Post link: Getting a nice transition effect with jquery, php sessions and a page refresh?

I am looking to make a nice transition effect for a dynamic user layout system I have created. My layout relies on a session being either the value of 1...

]]>
Post link: Getting a nice transition effect with jquery, php sessions and a page refresh?

I am looking to make a nice transition effect for a dynamic user layout system I have created.

My layout relies on a session being either the value of 1 or 2, I then call the layout using a switch statement.

switch ($  _SESSION['layout']) {

    case 1: break;
    case 2: break;
}

I have also created a button that they can click to change the layout using ajax. The jquery for this is like so:

$  ('#changeLayout').click(function() {

    $  .ajax({data: {changeLayout: 'mainLayout'}});
    $  ('#fluidWrap').fadeOut();
    setTimeout(function() {
        window.location = 'http://www.example.com/preferences';
    }, 1000);
return false;
});

The ajax is as follows:

if ($  _SESSION['layout'] == 1) {

    $  q = $  dbc -> prepare("UPDATE layout SET layout = 2 WHERE id = ?");
    $  q -> execute(array($  _SESSION['id']));
    $  _SESSION['layout'] = '2';
}
else {
    $  q = $  dbc -> prepare("UPDATE layout SET layout = 1 WHERE id = ?");
    $  q -> execute(array($  _SESSION['id']));
    $  _SESSION['layout'] = '1';
}

Now at the minute when the user clicks the button to change the layout the div #fluidWrap fades out, the ajax request has 1 second to change the session data and add it to the database, and the page reloads. All works well.

I was wondering how I can improve on this to maybe make a transition effect where the page slides out and slides back in again, how would I go about doing this?

I can’t add an effect with jquery for the div #fluidWrap to fade in, as on every load of the page it will of course fade in. How can I tell jquery to only fade in the body if the button was clicked after a page load?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/feed/ 0