FAQ Database Discussion Community


Absolute PNG image won't link

php,click,absolute
So I am working to make a change on this site. http://www.kbduct.com . One the site there is a png file of a transparent united states logo on the front. I had to add a small awfs logo banner to it and have the viewer be able to click on...

expand/collapse 2/3 of the table using jquery when clicked

javascript,jquery,html,css3,click
I am trying to expand and collapse 2/3 of the table rows when clicked on the footer. <table class="planTable"> <tbody> <tr> <th>Plan</th> </tr> <tr class="cartItemGroup"> <td > 10 GB </td> </tr> <tr class="cartItemGroup"> <td > 300 MB </td> </tr> <tr class="cartItemGroup"> <td > 1 GB </td> </tr> <tr class="cartItemGroup"> <td...

Selenium Click() not working with scrapy spider

javascript,selenium-webdriver,click,web-crawler,scrapy
I am trying to scrape links to product pages from a listing page using a scrapy spider. The page shows the first 10 machines and has a button for 'show all machines' that calls some javascript. The javascript is reasonably complicated (i.e. I can't just look at the function and...

Handling events for mouse click and keydown or keypress (for non-modifier keys)

javascript,events,click,combinations,keypress
I am new to JS and trying to learn on my own - thanks for any help! I am trying to have a simple program respond to a click differently depending on what other key is pressed at the time of the mouse click. I have searched far and wide...

Please help create code to calculate the percent of clicks on the button

android,click,logic,imagebutton
I am a novice developer. Please help to create the code to count clicks on the buttons (on Android). I have three ImageButton (IB1, IB2, IB3) and I have 3 empty TextView (TV1,TV2, TV3). However, the counter should not be considered the number of clicks each of the three buttons....

Change class on click based on current class

jquery,click,font-awesome,addclass,removeclass
I want to take a simple FontAwesome icon: <div class="emotion"> <i class="fa fa-smile-o"></i> </div> and swap the class depending on what the current class is: $(".emotion .fa-smile-o").click(function (){ $(this).removeClass('fa-smile-o').addClass("fa-meh-o"); }); $(".emotion .fa-meh-o").click(function (){ $(this).removeClass('fa-meh-o').addClass("fa-frown-o"); }); $(".emotion .fa-frown-o").click(function (){ $(this).removeClass('fa-frown-o').addClass("fa-smile-o"); }); But currently this only works for the first class...

Back to top button doesn't click - jquery

javascript,jquery,button,click
I am trying to achieve the "back to top" feature on a page through simple jquery. The "BACK TO TOP" button appears/disappears as expected. When it appears if I click on it, I expect it to go to the top of the page, instead nothing happens. I am not sure...

android toolbar menu item clicks

java,android,listview,click,toolbar
So I have this 'add' item in my toolbar. This item is supposed to add views to a listView below the toolbar and it works when you press it the first time. However, once the first view is added you cannot add anymore. How do I fix this? @Override public...

Disabling and enabling click event on image…jquery

javascript,jquery,click
what would be the best way to enable and then re-enable and image click with jquery? I can diasble the click event easy enough $(document).on("click", "#rightPager", function () { if (condition) { $(this).click(false); } }); how would I go about in 'enabling' the click event again based on a certain...

jquery addClass() function

jquery,css,click
This is the css i'm trying to apply to all the keywords #showKeywords { background-color:#5B1762; } What i want to do is when you click the showKeywords button the keywords are highlighted. However instead of highlighting the keywords it applies the css style to the button. I notice that the...

Check if elements clicked in a specific order

javascript,jquery,validation,click,order
I am beginner on JavaScript and I need to do a test for children. I have 3 square and I need to check and display if this was clicked in a specific order, defined by "order" property. The validation of click is displayed on corresponding span element status-1 for click...

How to make Drawer icon and logo two different button in ActionBar

android,android-actionbar,click,home,drawer
I have a problem where I need to be able to click both the logo and the backarrow+hamburger/cater from my action bar. when i don't have anything in my backstack, Hamburger icon is displayed and is opening my left drawer (then via animation it changes to arrow to close the...

checking an element is clicked not working jquery

jquery,css,click
I have a dialog box which get list of students from an ajax call and I am loading the data with .html() method of jquery. I put the html data like this into the dialog box.I want to make each student name clickable.When I click first,the background of selected .student_list_div...

Making a neat, installable Python library with Click

python,click,command-line-interface,setuptools
I'm trying to make a command line tool with Click in Python, and I can't seem to find any documentation on packaging up the library into something that's installable. Is there any way to do this? At the moment I'm just using a virtual environment and installing it for testing...

Click event not registering on div element (jQuery/HTML/CSS)

javascript,jquery,html,css,click
This is my game: (i can't post images yet so I have to explain with words) This is a Connect 4 game. Imagine 7 div columns. The 7 columns have 6 div chip objects stacked in each column element. (7x6 grid with 42 chips) I put each chip (each black...

Checking if a label I click, is a part of a pattern of labels

c#,list,design-patterns,click,label
I am making a game about remembering a pattern of labels, that show up by them changing colors. The user then has to click the labels showed, in the correct order. After the pattern has been randomly chosen, it goes into a list called the 'pattern'. My problem here is;...

.click() fails after dom change

jquery,dom,click
I searched on web but I didn't find any answer since this "problem" is not the usual one about the difference between .on() and .click(). With jquery 2.1.3 the click function is a shortand for on.("click", handler) so it should fire a function (or wathever) after the dom is changed....

on(click, …) not working on dynamic div

javascript,jquery,click
I'm attempting to perform a jQuery click function inside a dynamically loaded div. I've looked and implemented many of the tactics I've run across to no avail, the last being here. The code that I'm running to load the div: $(window).load(function(){ function showitusers() { $("#creatorsettingsdiv").load('http://XX.XX.XX.XX/quizzes/js/creatorusersdiv.php'); } $("#creatorsettingsusersbutton").click(function() { var usersvar...

Clicking child element fires parent click event

jquery,click
I know this question has been asked a few times, but I cannot seem to get this working. When the child gets click, I don't want the parent event firing. I have the following: <div class="tabItem"> <span> Item 1</span> <div class='contentBody'>Item 2 Body</div> </div> And the following jquery: $(document).ready(function() {...

jquery click not binding even when using “.on” [duplicate]

jquery,click,bind
This question already has an answer here: Event binding on dynamically created elements? 8 answers This is something I've done 100 times, but I can't spot why it's not binding. I'm creating a itemized list from a TAFFY database. // get matching data from tfPLdata var ts=""; var match=0;...

jQuery handle button click inside a form

javascript,jquery,forms,function,click
i don't understand why a button inside my form can't be reached with my jQuery code. <form action=""> <div class="field"> <label for='username'>Insert username</label> <input type="text" id="username" name="username"> </div> <button type='submit' class='btn btn-lg btn-primary buttonRegister'>Register</button> </form> Here are my jQuery on click try codes: $('.buttonRegister').submit(function(){ //action inside function }); --------------OR----------------------...

How to Click a List Item Where Title Attribute Equals a Specific Variable Using Javascript/Jquery?

javascript,jquery,list,click,title
I've got the following lists in my web application: <li class="ui-corner-all" title="#3100ff" style="border: none; background-color: rgb(144, 0, 255);"></li> <li class="ui-corner-all" title="#9330ff" style="border: none; background-color: rgb(144, 0, 255);"></li> <li class="ui-corner-all" title="#500055" style="border: none; background-color: rgb(144, 0, 255);"></li> Basically, I am trying to get JS and/or JQuery to click the list item...

How to use same options for cmd in the same group by using python-click

python,click
I have code like below, both foo and bar has user option and i need write @click.option('--user', default='*') twice for each function. actually, i have a lot of cmds like this, so it is a lot of repeat code. @click.group(help="cmd group") def main(): pass @click.command(name='foo') @click.option('--user', default='*') def foo(user): click.secho(user,...

click textbox (to enter characters), when submit is clicked

textbox,click,submit,enter
If click the submit button or a-element(<a> Send </a>) then automaticly the input text is clicked. thanks in advance. function send() { var txt = document.getElementById("textbox"); txt.click(); } <input type="text" id="textbox" name="textbox" style="width:90%;"> <a id="send" style="display:none;" onclick="send()" href="">Send</a> ...

How to select 3rd 'a' tag in a list for RSpec test?

ruby-on-rails,rspec,css-selectors,click,rspec-rails
How do I select a link in a list to click on for an rspec acceptance test. The code for the view is (in html): %ul.exports %li.model .name Model 1 .control link_to 'Export', export_model_path(:model1) I've tried (page.find("a")[:href] = "/admin/export/users").click and the response is 'Capybara Ambiguous match'. I've also tried variations...

Add click action to countries in raphael JS world map

javascript,html,svg,click,raphael
I'm making a world map in which you click a region (North America, Asia etc. ) using raphaeljs and world.js shapes @David Noël has opensourced a way of combining countries into one element which highlights when you rollover, which I have done succesfully. I'm usually OK with Javascript but I...

FadeIn 1000 when add class by Click

jquery,html,onclick,click
I'm trying to fadeIn 1000 when add class by Click function. I have tried this: http://jsfiddle.net/rf7mudL5/ HTML <span class="date-outer">Text will Red on fadeIn</span> <button class="more-recent-button"></button> JS $(".more-recent-button").click(function(){ $(".date-outer").fadeIn("1000").addClass("more-date-outer"); }); So how to opacity fadeIn when Class will add by click button? Is possible this: when click button, content will fadeIn...

jquery on click doesnt work on ajax generated content

jquery,ajax,click,live
I'm using jQuery("#content").on('click', 'a', function() {}); to add an Amazon Affiliate tag to my content. My content is generated by an ajax call. The click is being caught by my script; but the link is not modified. jQuery(document).ready(function() { jQuery("#content").on('click', 'a', function() { addAffiliate(this); }); amazonFRTag = "tag=XXXXXXX-21"; function addAffiliate(link)...

How to get Title Value by Clicking List Item With a Class Used by Multiple List Items

javascript,jquery,click,title
In my web application, I have the following list items: <li class="ui-corner-all" title="#3100ff" style="border: none; background-color: rgb(144, 0, 255);"></li> <li class="ui-corner-all" title="#9330ff" style="border: none; background-color: rgb(144, 0, 255);"></li> <li class="ui-corner-all" title="#500055" style="border: none; background-color: rgb(144, 0, 255);"></li> When I click a list item with the class "ui-corner-all", I am trying...

Simulate click on GMail div button with JS

javascript,click,gmail,simulate
I want to simulate click on GMail COMPOSE button using JS without JQuery. Here is button: <div class="T-I J-J5-Ji T-I-KE L3" role="button" tabindex="0" gh="cm" style="-webkit-user-select: none;">COMPOSE</div> Here is my js: var element = document.getElementsByClassName('T-I-KE')[0]; element.click(); Result:undefined in all browsers Image: http://i.imgur.com/4IX9DZX.png Already tried that: var event = document.createEvent("MouseEvent"); event.initEvent("click",true,true); var...

Jquery each click ajax not working

jquery,ajax,click
Been working on an ajax post function which works on it's own - however if I have two instances of the widget then both get fired and display the error message's instead of just the one. I'm trying the .each() to bind the click but it doesn't want to work....

How to preload and