jQuery Plugins » window https://jqueryplugins.info jQuery plugins, tutorials and resources Tue, 18 Oct 2011 10:13:40 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 Stop input type file from opening ‘open window’ https://jqueryplugins.info/2011/10/stop-input-type-file-from-opening-open-window/ https://jqueryplugins.info/2011/10/stop-input-type-file-from-opening-open-window/#comments Tue, 11 Oct 2011 04:21:51 +0000 Admin https://jqueryplugins.info/2011/10/stop-input-type-file-from-opening-open-window/ Post link: Stop input type file from opening ‘open window’

How can I stop input type=file from opening ‘open window’ without disabling it? Any method I can try using jquery or javascript? newest questions tagged jquery – Stack Overflow

]]>
Post link: Stop input type file from opening ‘open window’

How can I stop input type=file from opening ‘open window’ without disabling it? Any method I can try using jquery or javascript?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/stop-input-type-file-from-opening-open-window/feed/ 0
It’s possible show an input window requesting information to the user in the browser? https://jqueryplugins.info/2011/10/its-possible-show-an-input-window-requesting-information-to-the-user-in-the-browser/ https://jqueryplugins.info/2011/10/its-possible-show-an-input-window-requesting-information-to-the-user-in-the-browser/#comments Fri, 07 Oct 2011 19:14:26 +0000 Admin https://jqueryplugins.info/2011/10/its-possible-show-an-input-window-requesting-information-to-the-user-in-the-browser/ Post link: It’s possible show an input window requesting information to the user in the browser?

I want to do with Javascript or jQuery the same I do with JOptionPane.showInputDialog() in Java. Show an input window to the user enter some information. How can I do...

]]>
Post link: It’s possible show an input window requesting information to the user in the browser?

I want to do with Javascript or jQuery the same I do with JOptionPane.showInputDialog() in Java.

Show an input window to the user enter some information.

How can I do this?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/its-possible-show-an-input-window-requesting-information-to-the-user-in-the-browser/feed/ 0
Jquery iframe with Modal Window pass parameter https://jqueryplugins.info/2011/10/jquery-iframe-with-modal-window-pass-parameter/ https://jqueryplugins.info/2011/10/jquery-iframe-with-modal-window-pass-parameter/#comments Thu, 06 Oct 2011 15:14:22 +0000 Admin https://jqueryplugins.info/2011/10/jquery-iframe-with-modal-window-pass-parameter/ Post link: Jquery iframe with Modal Window pass parameter

Hello I have a problem when I modify the input of a iframe that is open with SimpleModalWindow Plugin. I have the code: $ ("#imgTab").click(function(){ $ ("#iframeNode").contents().find("input[name='objParent']").val('val1'); $ ("#modalWindow").modal({ opacity:80,...

]]>
Post link: Jquery iframe with Modal Window pass parameter

Hello I have a problem when I modify the input of a iframe that is open with SimpleModalWindow Plugin.

I have the code:

 $  ("#imgTab").click(function(){
    $  ("#iframeNode").contents().find("input[name='objParent']").val('val1');
    $  ("#modalWindow").modal({
    opacity:80,
    overlayCss: {backgroundColor:"#fff"}
    });
});

the iframe is in a div

    <div id="modalWindow" style="display:none;background-color:#FFFFFF">
    <iframe src="biblioteca.php" height="600px" width="900px" id="iframeNode" name="iframeNode"></iframe>
</div>

And the element to modify into the iframe is:

<input type="text" name="objParent" id="objParent"/>

Thanks.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/jquery-iframe-with-modal-window-pass-parameter/feed/ 0
Javascript page reload while maintaining current window position https://jqueryplugins.info/2011/09/javascript-page-reload-while-maintaining-current-window-position/ https://jqueryplugins.info/2011/09/javascript-page-reload-while-maintaining-current-window-position/#comments Wed, 28 Sep 2011 03:14:37 +0000 Admin https://jqueryplugins.info/2011/09/javascript-page-reload-while-maintaining-current-window-position/ Post link: Javascript page reload while maintaining current window position

How do i refresh the page using javascript with out the page returning to the top. My page refresh using a timer but the problem is it goes back to...

]]>
Post link: Javascript page reload while maintaining current window position

How do i refresh the page using javascript with out the page returning to
the top.

My page refresh using a timer but the problem is it goes back to the top every time
it reloads. It should be able to retain the current position of the page as it refresh.

p.s.
Addition mouse events are welcome if necessary to be a part of your suggestion.
I’m actually thinking of #idname to target on refresh but my html elements doesn’t have ID’s,
only class name.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/javascript-page-reload-while-maintaining-current-window-position/feed/ 0
How to stay on current window when the link opens in new tab? https://jqueryplugins.info/2011/09/how-to-stay-on-current-window-when-the-link-opens-in-new-tab/ https://jqueryplugins.info/2011/09/how-to-stay-on-current-window-when-the-link-opens-in-new-tab/#comments Thu, 22 Sep 2011 23:13:55 +0000 Admin https://jqueryplugins.info/2011/09/how-to-stay-on-current-window-when-the-link-opens-in-new-tab/ Post link: How to stay on current window when the link opens in new tab?

When a user clicks on a link <a href="www.stackoverflow.com" target="_blank">click</a> is there a way to stay on the current window instead of going to the tab ? newest questions tagged...

]]>
Post link: How to stay on current window when the link opens in new tab?

When a user clicks on a link

<a href="www.stackoverflow.com" target="_blank">click</a>

is there a way to stay on the current window instead of going to the tab ?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/how-to-stay-on-current-window-when-the-link-opens-in-new-tab/feed/ 0
Adding dynamic html to modal causes window to scroll up https://jqueryplugins.info/2011/09/adding-dynamic-html-to-modal-causes-window-to-scroll-up/ https://jqueryplugins.info/2011/09/adding-dynamic-html-to-modal-causes-window-to-scroll-up/#comments Thu, 22 Sep 2011 19:16:39 +0000 Admin https://jqueryplugins.info/2011/09/adding-dynamic-html-to-modal-causes-window-to-scroll-up/ Post link: Adding dynamic html to modal causes window to scroll up

Explanation: I have a modal that pops up when an html element is clicked. The modal is then appended to the document body and is positioned absolute. The top and...

]]>
Post link: Adding dynamic html to modal causes window to scroll up

Explanation: I have a modal that pops up when an html element is clicked. The modal is then appended to the document body and is positioned absolute. The top and left css attributes are set based of the element’s offset that was clicked to trigger the modal.

Problem: The modal fires properly and is positioned appropriately. There is a button within the modal that has a click function that adds further markup to the modal. When the button is pressed the markup is added correctly, but if the window is scrolled to any position, the window scrolls directly to the top.

What is the cause of the window scrolling and how can I prevent it from happening?

Thanks.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/adding-dynamic-html-to-modal-causes-window-to-scroll-up/feed/ 0
Window starts with scrolled to the bottom WordPress detailed page https://jqueryplugins.info/2011/09/window-starts-with-scrolled-to-the-bottom-wordpress-detailed-page/ https://jqueryplugins.info/2011/09/window-starts-with-scrolled-to-the-bottom-wordpress-detailed-page/#comments Tue, 06 Sep 2011 07:13:05 +0000 Admin https://jqueryplugins.info/2011/09/window-starts-with-scrolled-to-the-bottom-wordpress-detailed-page/ Post link: Window starts with scrolled to the bottom WordPress detailed page

I have an issue where a specific page is starting with scrolled down at the detailed page of WordPress. Is there a way to overcome this issue? What could be...

]]>
Post link: Window starts with scrolled to the bottom WordPress detailed page

I have an issue where a specific page is starting with scrolled down at the detailed page of WordPress.

Is there a way to overcome this issue?

What could be the cause?

I’ve tried:

$  (document).live('ready',function(){
     $  ('html, body').animate({scrollTop:0}, 'slow');
     });

But it doesn’t seem to work…

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/window-starts-with-scrolled-to-the-bottom-wordpress-detailed-page/feed/ 0
Open a new window in a facebox https://jqueryplugins.info/2011/09/open-a-new-window-in-a-facebox/ https://jqueryplugins.info/2011/09/open-a-new-window-in-a-facebox/#comments Thu, 01 Sep 2011 01:13:18 +0000 Admin https://jqueryplugins.info/2011/09/open-a-new-window-in-a-facebox/ Post link: Open a new window in a facebox

I am using jQuery facebox to open a new window for authenticating Facebook users with Devise/Omniauth in my rails app. At first I wanted to simply load this in a...

]]>
Post link: Open a new window in a facebox

I am using jQuery facebox to open a new window for authenticating Facebook users with Devise/Omniauth in my rails app.

At first I wanted to simply load this in a div like so:

$  ('#facebook-auth').live 'click', ->
  $  .facebox '<div id="foo"></div>'
  $  ('#foo').load $  (this).attr 'href'
  false

But the problem is that this will not work because there are multiple redirects. The first link opens /auth/facebook, which redirects to graph.facebook.com, which redirects back to my callback url, which finally redirects to a confirmation page. I need to display the confirmation page to the user. The way I have it working right now is by opening an external window like this:

$  ('#facebook-auth').live 'click', ->
  width = 600
  height = 400
  left = (screen.width / 2) - (width / 2)
  top = (screen.height / 2) - (height / 2)
  window.open $  (this).attr('href'), 'authPopup', "menubar=no,toolbar=no,status=no,width=#{width},height=#{height},toolbar=no,left=#{left},top=#{top}"
  false

Is there a way for me to open a new window and load its contents in the facebox? Or is there a better approach?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/open-a-new-window-in-a-facebox/feed/ 0
Why will my JQuery only run if I place window load function within? https://jqueryplugins.info/2011/08/why-will-my-jquery-only-run-if-i-place-window-load-function-within/ https://jqueryplugins.info/2011/08/why-will-my-jquery-only-run-if-i-place-window-load-function-within/#comments Wed, 31 Aug 2011 03:15:12 +0000 Admin https://jqueryplugins.info/2011/08/why-will-my-jquery-only-run-if-i-place-window-load-function-within/ Post link: Why will my JQuery only run if I place window load function within?

My following code will not function, unless I place it all $ (window).load(function(){ // within here } How can I get my code to run without requiring the above function?...

]]>
Post link: Why will my JQuery only run if I place window load function within?

My following code will not function, unless I place it all

$  (window).load(function(){
// within here
}

How can I get my code to run without requiring the above function?
Thanks!

My code:

// Player controls
    var timer = null;
    $  ('#left').mousedown(function() {
                moveLeft(); // Do it now
                timer = setInterval(moveLeft, 5); // Then every 100 ms
          }).mouseup(function() {
                clearInterval(timer); // And stop it
          });

    function moveLeft() {
          var nextpos = parseInt($  ('#player').css('left')) - 5;
          if (nextpos > 0) {
                $  ('#player').css('left', nextpos + 'px');
          }
    }
    $  ('#right').mousedown(function() {
                moveRight(); // Do it now
                timer = setInterval(moveRight, 5); // Then every 100 ms
          }).mouseup(function() {
                clearInterval(timer); // And stop it
          });

    function moveRight() {
          var nextpos = parseInt($  ('#player').css('left')) + 5;
          if (nextpos < PLAYGROUND_WIDTH - 100) {
                $  ("#player").css("left", ""+nextpos+"px");
          }
    }

// Timer
$  (function(){
    var timercount = 30;
      countdown = setInterval(function(){
        $  ("#timer").html(timercount);
        if (timercount <= 0) {
          $  ("#timer").html("TIMES UP");
        }
        timercount--;
      }, 1000);
});

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/08/why-will-my-jquery-only-run-if-i-place-window-load-function-within/feed/ 0
How to create dynamic div height based on the height of a browser window? https://jqueryplugins.info/2011/08/how-to-create-dynamic-div-height-based-on-the-height-of-a-browser-window/ https://jqueryplugins.info/2011/08/how-to-create-dynamic-div-height-based-on-the-height-of-a-browser-window/#comments Sat, 27 Aug 2011 20:46:27 +0000 Admin https://jqueryplugins.info/2011/08/how-to-create-dynamic-div-height-based-on-the-height-of-a-browser-window/ Post link: How to create dynamic div height based on the height of a browser window?

Question by John M: How to create dynamic div height based on the height of a browser window? We’ve all seen elastic width web pages. How can I create a...

]]>
Post link: How to create dynamic div height based on the height of a browser window?

Question by John M: How to create dynamic div height based on the height of a browser window?
We’ve all seen elastic width web pages. How can I create a similar look vertically?
I basically have a div that needs to be a maximum height of 600px, so it will stay that size no matter how big the browser window is. But as the browser window height becomes less than 600px, the div height needs to shrink proportionately until its minimum height is about, say, 100px.
Anyone know how to do this? I’d like to use css, but javascript or jquery will work as well…

Best answer:

Answer by gitter1226
Sure, this isn’t too hard.

First you have to create the javascript event handler for the window’s on_resize event (check spelling).

In that function grab the height of the window height property off the dom and set the div height appropriately.

That window height is found differently depending on the browser. In IE it is document.body.offsetHeight and in Firefox it is window.innerHeight. You can then use getElementById to get a handle on your div and use div.style.height = yourValue; Just set that height to the height of the window and cap it at 600 and 100 using code.

Add your own answer in the comments!

]]>
https://jqueryplugins.info/2011/08/how-to-create-dynamic-div-height-based-on-the-height-of-a-browser-window/feed/ 1