I am trying to make a Google Chrome app that automatically opens a YouTube site and clicks on the expand button, or any button.
I tried to use the following JavaScript:
$('#logo').click(); , .trigger('click');
But nothing happens.
Does anybody know how to do it?
Thanks
The thing you're clicking must be clickable. There is a link around the logo (id="logo-container") you need to click that, not the logo itself. Right click on the logo in chrome, select inspect element and then you'll see what the <a> tag is around the img.
Try this:
$('#logo-container').click();
Related
I am working with selenium for the first time, and I'm trying to play a video on another website.
I've already managed to play the video, but now I'm stuck trying to make it full-screen. The full-screen button is hidden unless I hover with my mouse over it.
So I searched for a solution and everybody suggests to use switch_to.frame() and then access the button, but it seems like no frame surrounds the video in my case. I'm not an expert in HTML so maybe I am getting this wrong, but is there a way to click that full-screen button when there's no frame surrounding the video?
Thanks in advance for any help :)
If there isn't an iframe containing the video, you should be able to click the button like you would any other on the screen. To get the hover menu to appear you can use ActionChains(driver).move_to_element(element).perform().
If you're having issues finding the button, you may also be able to video_player.send_keys("f"). Many players will use that shortcut to switch to fullscreen.
I am creating an app for network design and I need to be able to load a blank div when the user clicks on the New button.
The JQuery UI has a functionality exactly how I want it to be but it uses text area and if I use this, I won't be able to click and drag into the div.
This is the link.
These are my codes found on liveweave: http://liveweave.com/neFP7y and the following is the screenshot:
I need the tab to open in the blank space. Any idea how I can do this please?
Thanks.
<div> your page
<iframe src="http://www.w3schools.com//" height="400px;"></iframe>
</div>
This is what i'm trying to create CodePen example
The idea is that the popup should work exactly like the Pinterest Link
The problems i have are:
When u close the pop-up, the page always jumps to the top. It should stay where it was
The popup is fixed, how can i make it that you can move it like on Pinterest? I would like to have some spacing on the top and when u scroll u actually move the up
If u have any chance to view this on mobile, please do. I want to make the site responsive. If u view the pop-up in the mobile version, it isn't smooth. That means when u scroll and move you finger from the touch screen, the scroll stops immediately. So it feels like you need to push the content down with you finger. It doesn't flow so u could swipe and it would stop slowly
I try to figure this out for days already and can't get it. Any help is welcome :) tnx!
Instead of using anchor tag for the close button like this :
<div class="close">close</div>
Do this instead :
<span class="close">Close</span>
Don't forget to add cursor:pointer style for .close class.
Your problem will be solved.
Right now, the image that triggers popup disappears when you click close button on firefox just in case if you haven't checked on it yet. So, better not use anchor tag for the close button. My suggestion would be Never use anchor tag for close button.
Hope this helps.
I am using Shadowbox to display image on hover, but for some reason it works only AFTER I clicked the link for the first time. I am using Chrome and FireFox, neither working right.
You can see here: http://www.impero.co.za/demo/hsrc/site_content/view/how-we-curate-data
There is an anchor called "Qualitative Data". It does not open the Shadowbox on hover, but once I have clicked on it once, it opens, and from there onwards, it opens on hover.
As far as I can see from shadowbox's website, and Stackoverflow resources posts, I am doing this right.
Any idea what is wrong here?
Thanks in advance,
Kobus
Use Shadowbox.open(this); in your onmouseover attribute, e.g.
<a id="shadowbox[gallery]"
href="http://www.impero.co.za/demo/hsrc/assets/uploads/images/qualitativedata.jpg"
onmouseover="Shadowbox.open(this);"
rel="shadowbox[gallery]">Qualitative Data</a>
I thought this one was easy but I'm banging my head on the jumping part. I have a page, on this page I have tabs, I want to click on the 'read' link so that it (1) opens the tab and (2) jumps to that part of the page so user can keep reading. My code:
<a onclick="$('a[href=#tab-read]').click();">Read</a>
Like I said, works just fine, opens the tab I need but doesn't actually make the jump to it? I still have to scroll down the page to get to the content area.
Try this out, you can force the window to go anchor tag, or change up the selector to go to the desired element :)
$(window).scrollTop($('a[href=#tab-read]').offset().top);