I am opening a pop up screen on anchor tag I don't know why it is not open. I used many time this line to open the pop up. It always open. But this time it is not when I inspect it show 'display none' with no content.
I follow the steps
Press add button (generate row)
Click icon on the row (right side). Show pop up screen with edit and delete option.
Press edit. It should show pop up screen, but it is not showing...
http://jsfiddle.net/4ajeB/11/
$('.edit_h').click(function(){
alert("edit ID:"+$(this).data('originalId'));
$("#editTestCaseId").popup("open");
})
This may not be a solution, but it is certainly a workaround.
After tracing the CSS and finding that jQuery was probably just being too greedy with its class adding/removing logic, I decided to try the popup("open", ...) call manually using the console. As it turns out, it works fine when done that way. I tried putting the call in the code in different places and in multiples to no avail. As it turns out, other people have run into the same problem. The workaround posted here seems to do the trick:
setTimeout(function () {
$("#editTestCaseId").popup("open");
}, 100);
Why this has to be done? I have no idea.
JSFiddle: http://jsfiddle.net/4ajeB/12/
Related
So, I'm making a navbar where , when I'll be clicking an icon it'll move a bit upwards. And it works fine. But the problem is the icon is now stuck permanently on that place. How do I make it go back to original place when I click somewhere else??
i tried searching on yt and google but idk how to search it up in short and due to that i didn't get anything useful. I'm very new in JavaScript so a simple explanation would be best for me.. tnx!!
Personally, I would put the icon in the label element, which was linked (via for) to the input radio. And I would link the position to label:checked (in CSS class) And when another icon is clicked (which is maked the same way), the previous icon is automatically unchecked (by radio). And I don't even need javascript :-)
Im using Selenium to open a page. After I open the page, I want to click a some sort of refresh button. When I click it, Im getting this error:
ElementNotVisibleError: element not visible
This is the code I use to click the button:
driver.findElement(By.id(id)).click();
My guess is that the button goes not visible whenever it is pushed. And that maybe it starts off not visible as well. Cause it doesnt do a full page refresh.
Any way for selenium to check if something is visible, and maybe wait until it is?
Edit:
As it turns out, there are multiple buttons with the same ID. And the button I am trying to reach are way down. I tried to find the button with By.xpath, but I still couldnt find it. The way I did it, was to search for button by id, like this //button[contains(#id, 'abc')][1]. (Different number of course).
Selenium could not find the element, but I could find it with Chrome developer tools. Any suggestions?
Solution: 1 You can try using this code in a syso,
System.out.println("getting Page Source "+driver.getPageSource());
This method will return the entire page Source and you can check whether your button exists in the source or not. You can place the above code at several points in your function and check until you find the button in the source.
Solution: 2 In case your button does not exist in the source you will have to check and see whether the button is getting loaded in an iframe and if so you can use the following code and switch to the iframe and and then try finding the button,
driver.switchTo.frame(frameName);
In your case you could use Explicit wait to check when the element/button is clickable.
Try doing this
wait.until(ExpectedConditions.visibilityOfElementLocated(id))
Need help with the "our team" section halfway down this page: http://dev.doubleaevents.com/
When you click an image it opens to reveal more information. I'd like to be able to click another image and have the previously opened image collapse, so that a user can't open more than one image at a time.
Would also like to know if making them slide out to the right (instead of down) would be a simple fix?
I'm a js novice so any explanations are appreciated. Here's the js file for quick reference: http://dev.doubleaevents.com/wp-content/plugins/portfolio-gallery/assets/js/view-toggle-up-down.js
Try adding this:
jQuery('.portelement').each(function(){
if(jQuery(this).hasClass('large')){
jQuery(this).removeClass('large');
jQuery(this).animate({
height:240
},300);
}
});
before:
jQuery(this).parents('.portelement').addClass('large');
In your javascript code.
When you click an item you basically want to search for elements that are already open. Then from there remove the 'large' class name and close that element. From there you continue on to opening the selected element. Thats what this code does.
As far as your other question, it shouldn't be too difficult, just mess around with the animate method and css. But maybe look into the isotope documentation. There may be an option for that.
I'm up to upgrade my "wysiwyg" editor by adding new buttons to the toolbar. One of these buttons is called "add a slideshow" which works this way :
when I click the button, it shows up a popup window which tells me to add pictures that are gonna be in the slideshow.
then when I choose the pictures, a simple slideshow will be created and shown in the editor.
I made some research in the net and I found an enormous number of slideshow codes that each time when you wanna change the slide, you have to go to html code and change the attribute's value ... So instead of that, I just wanna make it easier to the user by doing this "popup window + automatic add of the pic to the slideshow"
If anyone of you guys have an idea about this, please help me to achieve this work.
PS: Sorry for my poor English :p
The unfortunate thing about wysiwyg text editors is, while some have options, usually what you see is what you get.
I have spent hours trying to figure this problem and i just can't, so if you think you got what it takes please give me a hand.
I am writing jQuery code to add a delete button (iphone style) in a web app. However I can't get it to hide the currently swiped delete when you swipe it for the second time (with intent to hide it). When you slide elsewhere it does hide the previous one.
Here is a jsfiddle example of the code by using click instead of swipe. You will notice if you click twice on the li it won't hide the delete. But if you click eslewhere it does.
the real code is
$("li.swipeDelete").live("swipe",function(){
var $th_btn = $(this).find(".aDeleteBtn");
$(".aDeleteBtn").removeClass("fadeInLeft");
$th_btn.toggleClass("fadeInLeft");
});
Thanks :)
I'm sorry to kill the party but right after i added it it came to me. Moving the removeClass after, and only removing the class if it already has class slideLeft and its NOT the current element.
var $th_btn = $(this).find(".aDeleteBtn");
$th_btn.toggleClass("fadeInLeft");
$(".aDeleteBtn.fadeInLeft").not($th_btn).removeClass("fadeInLeft");
I hope this can be used as a reference. I will also make a jquery plugin so everyone can enjoy this great feature.