When I click on a link to accept Terms and conditions, a modal box pops up.
I need to scroll the modal pop up down, enable the Accept button and then click Accept.
I'm not able to scroll the modal box.
I tried:
context.driver.execute_script("arguments[0].scrollIntoView(true);", ars)
Where ars is the last element in the popup. This shows the last element ars in the modal without scrolling down.
I also tried:
actions = ActionChains(context.driver)
actions.move_to_element(ars)
This has the same behaviour: shows the last element ars in the modal without scrolling down.
Any other methods to scroll down are highly appreciated.
TIA
First try to find the new iframe which contains the name of the modal box.
modal_box = driver.find_element_by_xpath('/html/body/div[2]/div.....')
driver.execute_script("arguments[0].scrollTop = arguments[0].scrollHeight", modal_box)
Make sure its scrolling for the entire height. Then try to find the visibility of the accept button
Related
I'm using wordpress with visual composer and I have built this demo popup example https://www.air8cushion.com/index.php/popup-test/ when I click on "More Info" button the popup shows up. However when I scroll content inside of it, and close the modal window, and again click on "More Info" I need to reset the content to appear from the top again.
I know its possible to do it with JS but I had fails many times to make it work. Most of examples of similar things online are mostly for Bootstrap and none of them worked for me.
Thanks.
You can use this on click of the close button of your popup
this function will scroll viewport of the popup div to top when clicked
jQuery(document).on('click','.vc_general',function(){
var myDiv = document.getElementById('myNav');
myDiv.scrollTop = 0;
});
".vc_general" is one of the class in your close button. You can add an extra class if you think it will affect the other functionality.
Actually i want to do open color box without popup and it need to be only show hide inside a div. can we target a div to open colorbox content.
<a href='#myGallery' class='group'>click here</a>
<div class=''><!--this must be container of colorbox, and disable popup-->
<div id="myGallery"><--some content with photo--></div>
</div>
function _teamPopup(){
$(".group").colorbox({
inline:true,
rel:'group',
href:$(this).attr('href'),
scrolling: false,
opacity:1,
width:100+"%",
});
}
on my web page , there is lot of thumbnails, when i click on it content must display without popup.and it can be next ,prev , close like colorbox group function.
please check below image and you can get some idea.
Use toggle function of jQuery to hide and show content inside an element
Why you want to change colorbox if its purpose is exactly to have a gallery popping up?
If you look around there are widgets more specific for the kind of problem you're having.
Check http://galleria.io/themes/classic/.
If you still don't like what you can find around why don't you just code the big div to change its image when clicking on a thumbnail?
I have made a form and if you click on the Info image it drops down with more information, however if i click on the image to close. It with close but then bounce back open.
If I click just next to the image it will close properly.
Any ideas why this happens?
link:
http://www.vestedutility.com.au/home_safety_check.php
Change the line from your code:
if(jQuery(e.target).is('.active')) {
To
if(jQuery(this).is('.active')) {
When I have an email open in Gmail, I'm trying to click the "Show original" dropdown menu item programmatically. The IDs of all the elements change dynamically with each email, so that's not a reliable way to find the menu item I'm trying to click. To start, I'm just trying to make a piece of JavaScript that clicks it in Chrome's console. After loading jQuery, I've tried this:
jQuery('div[role=menuitem]:contains(Show original)').click();
While it seems to select the proper div and click it, it's not the expected behaviour and the click doesn't really do anything. Here's a piece of a fully loaded email's menu containing the menu item I'd like to click with JavaScript:
<div class="J-N" role="menuitem" aria-hidden="false" id="so" style="-webkit-user-select: none;"><div class="J-N-Jz"><div><div id=":173" class="cj" act="32"><img class="dS J-N-JX" src="images/cleardot.gif" alt="">Show original</div></div></div></div>
My intention is to use a bookmarklet, but I'm having trouble loading jQuery in a bookmarklet because of a security warning, but that's another question/issue. Also, should I try to open the dropdown before clicking the "Show original" button or is it likely that I am able to click this button without opening the menu first?
You must open menu at least once, so Gmail loads required menu elements.
To click on elements use dispatchEvent() straight on DOM elements (not jQuery collections)
Basic example might look like this:
// Create events
var mouseDownEvent = new MouseEvent('mousedown', { 'bubbles': true });
var mouseUpEvent = new MouseEvent('mouseup', { 'bubbles': true });
// Get DOM elements
var menu = jQuery("div[role='button'][aria-label='More']").get(0);
var button = jQuery("div[role='menuitem']:contains('Show original')").get(0);
// Open and close menu, to ensure button existence
menu.dispatchEvent(mouseDownEvent);
menu.dispatchEvent(mouseDownEvent);
// Click menu item
button.dispatchEvent(mouseDownEvent);
button.dispatchEvent(mouseUpEvent);
That will work only in Chrome, Firefox and Opera.
I use the following splitview for my mobile application.
asyraf splitview
For example my first left content in the tablet view is a button. when I click the button it loads a new page with a second button and a back button to the first page. When I click on the second button it loads a right content.
When I click the back button it loads the first page left content but the right content is the same.
How can I on click the back button load a new left content and a new right content at the same time?
Attention: The right content call need a href="rightPage" and data-panel="main"
Attach the following to the button's click() event:
location.hash = "pagehash";