I need some method to scroll Fancybox popup down or scroll to element which is in the popup (when the poopup opened obviosly)
I red the documenmtation buut did not find the way.
Many thanks.
There is no such built-in method and you can simply use plain JavaScript (or jQuery) to scroll your element wherever you want. Maybe you can simply trigger focus on your element and the browser will do the rest.
Related
I'm clicking on a link that opens a new window with a PDF document. I switch to the new Window, which I verified that I was on by getting the URL. The window has a toolbar at the top which is visible for a few seconds when the window opens, and then hides itself unless you move the mouse again. I'm trying to click on the Download button, but anything I try gives an error that the CSS Selector can't find the element. I'm suspecting it's because of the nature of the animated toolbar, but I'm not sure. At first I was just trying a regular click:
element(by.id('download').click;
And that was not working. So I tried navigating the mouse to click on it:
browser.driver.actions().mouseMove(element(by.id('download'))).perform();
element(by.id('download')).click();
I've also tried selecting by css:
element(by.css('#download').click();
All give me -Failed: No element found using locator.
Could someone please tell me if what I'm doing is possible, and if so, how I might be able to accomplish it?
screencapture
Element
This is more of a workaround than a solution, but what works for me with elements that are for some reason not visible (covered with other elements or working only on hover) is to just inject a script. Like:
browser.executeScript(
"document.querySelector('[id=\"download\"]').click()"
);
I am using Fancybox3 to open iframe in popup, but I need deny close on click on overlay, because in iframe is form, which user must fill out.
I tried edit outsideClick parameter 'close' to 'false' in fancybox.js and this guide too, but it's still closing on click on overlay.
Can somebody help me? Thanks.
Simply use clickSlide option. v3 works as a slider and is highly customizable (for example, you can resize and/or reposition sliding area), therefore there is a seperate options for clicking the slide and overlay element.
If you have a jQuery dialog window such as this, and lets say you have a vertical scrollbar (E.g to much text where container has a specific height).
In IE you can then use arrows up and down alongside page up and down
however in chrome / firefox you can't they just scroll the outside page.
Is there anyway to make the behave the same?
This is more of an usability or accessibility issue with the modal dialog box.The best approach is to trap focus of the modal dialog i.e. tabbing should not move focus out of dialog box. And also put a tabindex=0 on ui-dialog-content so that div must get focus on tabbing and then you can use up and down arrow key to navigate content of modal dialog.
If you go to http://www.sharethis.com/ and click on the green shareThis widget next to the text 'Try it out', you'll see a window pop-up.
I've noticed everyone is beginning to use a pop-up window with this style.
What's this? Is it just a div or a new browser window? How to achieve this effect?
Check out any one of these:
Lightbox
Lightbox2
Fancybox
I guess the popup-window is actually two divs, one which darkens the site, one for the window.
Also guessing: both could use the "opacity" and "z-index" css attributes.
Is it possible without the help of a plugin to make a page scroll to a certain position on the click of a button?
Basically, if the user clicks a button a popup gets displayed in the center of the screen, if the user uses the button at the bottom of the page, the popup is sometimes out of view so I am wanting to couple the showing of the popup and scolling to the top of the popup on the clickup.
Is this possible?
Thanks
Using the CSS
position : fixed
is the best bet for your problem.
In case if you would like to know the way to scroll the page to certain position using jQuery then here it is.
Use jQuery's scrollTop() function in the following way.
jQuery(window).scrollTop(<position>);
Using jQuery to handle scrolling will also resolve any browser incompatibility.
You can get that effect with the scrollIntoView method. But it's probably better to centre your popup on the window rather than the document to avoid the problem in the first place ...
Sometimes lean and mean works nicely. No Plugins, No JQuery:
window.scrollTo()
Watch out for cross browser incompatibilities that might creep in. That's the point of JQuery ;)