w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Using jQuery to remove & add classes to buttons, the new class added won't work with it's click function
When you call $(".register_unselected").click() jQuery actually searches the DOM for any elements matching .register_unselected and then listens for click events on them. Since your element won't exist until after this method is called, this will have no effect. Instead, use $("body").on("click", ".register_unselected", function(){}); You could also replace body with another selector that will always contain the element changing classes. EDIT: Here's a forked CodePen: http://codepen.io/anon/pen/DqFuL

Categories : Jquery

Angular.js How to change an elements css class on click and to remove all others
have you tried with a condition in ng-class like here : http://jsfiddle.net/DotDotDot/zvLvg/ ? <span id='1' ng-class='{"myclass":tog==1}' ng-click='tog=1'>span 1</span> <span id='2' ng-class='{"myclass":tog==2}' ng-click='tog=2'>span 2</span>

Categories : Angularjs

Angular e2e testing. How to click dom elements ? (buttons links)
You can use generic jquery selectors to find elements.. here's some code from my e2e tests. Note especially the :eq(3) selector for taking the 4th anchor tag. it('The cancel button should close the form and revert the info', function() { input("ci.customer.name").enter("Tom Selleck") element('#customerinfo input[value="Cancel"]').click(); // check pdfdata to make sure it got reflected element('.navbar a:eq(3)').click(); expect(element('.navbar a:eq(2)').text()).not().toBe("Customer (Tom Selleck)"); });

Categories : Angularjs

Add and remove a Div element on click event with buttons
Try this. Add click event only on minus sign var i = 0; $('#addHotel').click(function () { $("<div><div>Hotel Name:</div><div class='minus'>-</div></div>").attr({ 'id': i, class: "addHotel" }).addClass('H').appendTo('#moreProd'); i++; }); $('.minus').on('click', '.H', function () { $(this).closest('.H').remove(); });

Categories : Jquery

Click anywhere to remove class
Use the jQuery one() function to remove whatever you need removed when the user clicks anywhere on the body of your page. one() triggers only once... so change your code to: $(".dButton").click(function(){ $("div ul.customDropDownList").addClass("clickButtonReveal"); $('body').one(function(){ $("div ul.customDropDownList").removeClass("clickButtonReveal") }); }); Just in case it is not clear: Remove the second function $('body').click(function(){...}) in your code. this replaces all your code.

Categories : Jquery

How to use Angular directives ng-click and ng-class inside Leaflet marker popup
Your issue comes from the fact that you are manually creating some DOM, which was not compiled by AngularJS. In those cases, you have to manually compile and link the element. The code would look like this: var html = '<br><span ng-class="thumbsUpClass(item)" ' + 'ng-click="addChoice(item,set)"><span class="popup-container"><span ' + 'class="icon-stack thumbs-up-stack"><i class="icon-sign-blank ' + 'icon-stack-base"></i><i class="icon-thumbs-up"></i></span></span></span>', linkFunction = $compile(angular.element(html)), newScope = $scope.$new(); newScope.item = hotelsSelectedDates[i]['hotels'][s] newScope.set = hotels var marker = L.marker([51.5, -0.09], {icon: blueIcon}).bindPopup(linkFunction(newSco

Categories : Javascript

Add/remove class on click to change background color of a div
Try this: $(document).ready(function(){ $('#block').on('click', function() { $(this).toggleClass('faded'); }); }); And put background-color: green for your faded class. However it might not work depending on your jQuery version. Working JSFiddle: http://jsfiddle.net/sVZtL/12/

Categories : Jquery

How to remove dotted outlines on links, buttons, inputs, textareas and buttons
Try using the appearance property: -webkit-appearance: value; -moz-appearance: value; appearance: value; for more info: http://css-tricks.com/almanac/properties/a/appearance/

Categories : CSS

remove the class due to which the on click event started after ajax call
Try using the context setting of jQuery. context: $(this) Your usage of $(this) inside your success callback is referring to the jqXHR object and not your original scope.

Categories : Jquery

How can I close a dropdown menu with a click anywhere else on the page and remove the class "selected"?
This should have all you need: http://jsfiddle.net/PysAY/5/ Other than getting the fiddle to work, I made very few changes. First, I made a new function, encapsulating what you were doing when the selected menu was clicked. Since you want the same functionality to occur when clicking off the menu at all, it should be its own function. var closeMenu = function() { $("#nav .selected div div").hide(); // hiding popups $("#nav .selected").removeClass("selected"); }; Then I changed your menu's click handler to call that function: $("#nav > li > a").click(function (e) { // binding onclick if ($(this).parent().hasClass('selected')) { closeMenu(); } else { // ... e.stopPropagation() I added lines at the top and bottom of your click handler to

Categories : Jquery

Angular ng-click won't fire if angular {{model}} is included as parameter
Found my own answer: within ng-click, there is no need for the {{notation}}. It knows that "item" is an angular data model. Again, not super clear in the Angular documentation. Here is the updated plunker that shows it working and not working.

Categories : Angularjs

How to remove selected items from listview when click remove button in android
I'm a little confused because I don't think your adapter shows what you want even before deletion because of this: public int getCount() { return count; } public Object getItem(int position) { return position; } Once your adapter will be correctly set with the array of data to display (in your case items I think) you just have to remove the objects you want delete from this array (items.remove(obj)) and then call notifyDataSetChanged() on the adapter. Edit: I think there is some logic problems in your code here. I assume that you want display data from an Array so you should probably extends ArrayAdapter in place of BaseAdapter. Next I think there is a confusion between item and item position. A classical implementation of getItem() is, for arrays, some

Categories : Android

AngularJS - ng-click does not remove previous click's modifications when clicked again
Since each single question has its own QuestionController, and QuestionControlleris where $scope.selected is being set, they don't interact with each other. That is to say, when you click edit, it sets selected for that individual controller. The easy way to fix it would be to set a property on a parent scope (the containing controller) when clicking edit: function MyCtrl($scope) { $scope.questions = []; $scope.AddRootQuestion = function(questions) { questions.push({name: 'Question', nodes: []}); }; // added this method --v $scope.setSelected = function(q) { $scope.selected = q; }; } function QuestionController($scope) { $scope.choices = []; $scope.choice = {text: ''}; $scope.AddSubQuestion = function(question, $element) {

Categories : Angularjs

Angular JS and raido buttons
Set the ng-model equal to the value of the radio you want checked. <input type= "radio" value= "point" ng-model= "mode"></input> <input type= "radio" value= "range" ng-model= "mode"></input> $scope.mode = "point";

Categories : Angularjs

on second click remove text from button click
<form> <textarea name="text" id="text" rows="10" cols="50"></textarea> <input type="button" name="insert" id="insert" value="Input text button" /> </form> <script type="text/javascript"> document.getElementById('insert').onclick = function() { var txt = 'Input this text in textarea on click', area = document.getElementById('text'); area.value = area.value.indexOf(txt) != -1 ? area.value.replace(txt, '') : area.value + txt; } </script> FIDDLE

Categories : Javascript

Angular + ui.bootstrap.buttons + radio filter
Is this along the lines of what you were thinking? http://jsfiddle.net/HB7LU/278/ Note your button needs to have an ng-class and an ng-click. The ng-click needs to be a function call that sets a scope variable rather than an assignment due to the ng-repeat, which creates child scopes. <button type="button" ng-repeat="title in titles" class="btn btn-default" ng-model="selected[title]" btn-checkbox ng-class="{active: title == selectedTitle}" ng-click="setSelectedTitle(title)">{{title}}</button> Then your function to select a variable: $scope.setSelectedTitle = function (value) { if ($scope.selectedTitle === value) { $scope.selectedTitle = undefined; } else { $scope.selectedTitle = value; } }; I wasn't sure if

Categories : Twitter

Angular radio buttons and custom input
Use a different model object other than the object used in the ng-value of the checkbox <input type="radio" data-ng-model="selectedEntry" data-ng-value="newText"> <textarea rows="4" cols="40" data-ng-model="newTextInput"></textarea> And then you can grab the value in the model newTextInput when you click the submit button if the third one is selected. DEMO

Categories : Angularjs

Two buttons, one click
Is there a way for the top button to tell the bottom button to activate when the top one gets pressed. Not really, but you can have the action for the top button call the action for the bottom button. Here's one way: - (IBAction)actionTop:(id)sender { NSLog(@"The top button was activated."); [self actionBottom:self]; } - (IBAction)actionBottom:(id)sender { NSLog(@"The bottom button was activated."); } Another way would be to use the same action for both, and figure out what to do based on which button triggered the action: - (IBAction)action:(id)sender { // if the top button was tapped, do this part if (sender == self.topButton) { NSLog(@"The top button was activated."); } // you want the bottom button to be activated no matter which button

Categories : Objective C

How do I access my angular scope from jQuery dialog buttons?
You can use Angular functions to find the scope attached to an element and call a function on it. I prefer to really abstract it away and find the root of the ng-app and broadcast an event into the app so that the outside-code doesn't know about the specifics of the inside code except for the event that you broadcast. angular.$externalBroadcast = function (selector, event, message) { var scope = angular.element(selector).scope(); scope.$apply(function () { scope.$broadcast(event, message); }); }; Then, from any code, you can call something like: angular.$externalBroadcast('#app-container', 'doSomething', parameters); And inside the app, I'd do something like this: $rootScope.$on('doSomething', function(parameters) { // handle the external event. }); If yo

Categories : Angularjs

Intent : remove Always / Only once buttons
That is a system generated dialog, so you cannot alter it. You could use queryIntentActivities() to get a list of the apps which can respond to your intent, and then show them in your own dialog without the buttons if you like.

Categories : Android

Multiple buttons on click same function
By default, a QLabel has no "clicked" signal. But you can do your own QLabel with 2 integers (row, col) and when you've got a mouseReleaseEvent (or mousePressEvent), you send a custom signal that looks like this: clicked(int row, int col). You can also use a QSignalMapper: http://qt-project.org/doc/qt-4.8/qsignalmapper.html#details

Categories : C++

Buttons are not working on single click Wpf
Try handling the PreviewMouseDown or PreviewMouseLeftButtonDown events instead. Sometimes the bubbling Routed Events get internally used by controls. For more information, please view the UIElement.PreviewKeyDown Event and UIElement.PreviewMouseDown Event pages at MSDN.

Categories : C#

iFrame not allowing me to click buttons
Try to add full address to PDF file. I added: http://www.selab.isti.cnr.it/ws-mate/example.pdf It works fine for me on Chrome Version 28.0.1500.95, Mac OS X 10.8

Categories : HTML

How to click buttons after creating with jQuery?
Just use Jquery like this : $("#select" + array[i]).click(); Or without loop : http://api.jquery.com/attribute-starts-with-selector/ //Will execute the click event on all element where the id begins by "select" $('[id^="select"]').click();

Categories : Javascript

remove gap between buttons in navigation item rightbuttonitems
You can't remove it. You can work around it by creating a bar button item with a custom view, where that custom view has you custom buttons all added as subviews. In this way you can directly control the exact positioning.

Categories : IOS

Remove border navigation bar buttons monotouch
According to Add custom button to navigation controller without border, you could var button = new UIButton (new RectangleF (0, 0, 25, 25)); button.SetImage (new UIImage ("image"), UIControlState.Normal); NavigationItem.LeftBarButtonItem = new UIBarButtonItem (button); of course, if you want some control over your BarButtonItem, you can do this: var button = new UIButton (new RectangleF (0, 0, 25, 25)); button.SetImage (new UIImage ("image"), UIControlState.Normal); var buttonItem = new UIBarButtonItem (button); buttonItem.SetTitleTextAttributes(...); NavigationItem.LeftBarButtonItem = buttonItem;

Categories : C#

How to remove prev/next buttons from pagination function?
Why not just leave it? Also Bones official Git can be helpful, open a support issue there with this question. Anyways try this untested code : Change this: if ($end_page < $max_page) { $last_page_text = __( "Last", 'bonestheme' ); echo '<li class="bpn-last-page-link"><a href="'.get_pagenum_link($max_page).'" title="'.$last_page_text.'">'.$last_page_text.'</a></li>'; } To this: if ($end_page < $max_page && != $max_page) { $last_page_text = __( "Last", 'bonestheme' ); echo '<li class="bpn-last-page-link"><a href="'.get_pagenum_link($max_page).'" title="'.$last_page_text.'">'.$last_page_text.'</a></li>'; }

Categories : Wordpress

jQueryUI add click function for multiple buttons
for close dialog box simple use by this all dialog box close they all inherit the same class, this is the best way to select all and close by: $(".ui-dialog-content").dialog("close");

Categories : Javascript

How to add click events for dynamically added buttons
Change Toast.makeText(getApplicationContext(), v.getId(), 8000).show(); with Toast.makeText(getApplicationContext(), String.valueOf(v.getId()), 8000).show(); If you pass an int value as second parameter to makeText android will look for a String with that id inside R.string. If it does not exist your app will crash for android.content.res.Resources$NotFoundException:

Categories : Android

One .click event handler for multiple buttons
Event delegation: $(document).on("click", ".loadMorePhotos", function(){ alert("ok malaka!"); }); Because your elements are dynamically created, you have to bind the click handler to an element that already exists at DOM ready (in this case, document)

Categories : Javascript

Is there a way to auto click all buttons on a page that say approve?
If you do not have control over this page and it will be generated anyway, you can use Sikuli - it should be pretty easy to find all buttons that say "Approve" and go clicking them.

Categories : Javascript

2 buttons click,1 in master another in content page
If you are using normal ASP.NET, you can surround your textbox and button with a Panel. On that panel you can set the property "DefaultButton". Every control in this panel will trigger that DefaultButton when trying to submit form via the Enter keypress. <asp:Panel runat="server" DefaultButton="btnSearch"> <asp:TextBox runat="server" ID="txtSearch" Text="" /> <asp:Button runat="server" ID="btnSearch" Text="Search" /> </asp:Panel>

Categories : C#

How to remove these darn Buttons from Yahoo Media Player?
Nevermind, got it working with .remove() by adding a setInterval(functionToCheckForExistence, 500); Than within the function that checks if it exists, if it does it removes it, if not, than it clears the Interval. Works great now! Arggg, doesn't work in Firefox on Windows 7 (Tested and still shows)... arggg!

Categories : Jquery

Django Template: remove the buttons when session starts
There is another solution on this, based on the logged in user (requires that you use django build in auth system). You may access request.user.is_authenticated in your template and differentiate on its state (True is loggend in).

Categories : HTML

Is it possible to click buttons in the toolbar with macros in Excel 2010?
Here's how you can record a macro, which will capture your actions. For Excel 2010: http://www.dummies.com/how-to/content/how-to-record-a-macro-to-automate-tasks-in-excel-2.html For Excel 2013: http://www.dummies.com/how-to/content/how-to-record-new-macros-in-excel-2013.html In your case, to take this even further, you can do coded UI testing right from Visual Studio. For what you are trying to do, this is even better than only trying to automate a button-click to fire a custom add-in.

Categories : Excel

Using Watir to click on Radio Buttons with variable values
Try this: el.innerHTML="<input id='rad' type='radio' name='table-radiobutton' value='val' />radio"; var rad = document.getElementById("rad"); rad.onclick=function(){ alert('clicked'); }; Demo: http://jsfiddle.net/TZTGT/

Categories : Javascript

jquery binding click event to multiple buttons
Giving jQuery an array will combine each item into a bigger jQuery object, thus you can bind your events in one shot. Assume b1 and b2 is DOM element, not jQuery object. $([b1, b2]).click(function (evt) { // your code goes here }); JSFiddler at http://jsfiddle.net/XF3Vv/1/.

Categories : Jquery

Open dialog box on click on multiple buttons of similar name
Add a common class to all those buttons. For example: <input type="button" id="btnEditUser-1" class="btnEditUser" > <input type="button" id="btnEditUser-2" class="btnEditUser" > ....................... <input type="button" id="btnEditUser-n" class="btnEditUser" > An then add a click handler to all those (with jQuery for example): $('.btnEditUser').on('click', function(event){ //If you're in a form you may want to prevent the default behaviour (sumbit the form) event.preventDefault(); //Now most-probably you'd like to do something different for each button clicked: var buttonIdParts = $( this ).attr('id').split('-'); //Now you're left with the number from the id var buttonId = buttonIdParts[1]; switch(buttonId) { case 1: // ex

Categories : Jquery

How to select and depress a button on click, and undepress all the other buttons?
First assign a common class to all of them... ill call it difficulty-button then: $('.difficulty-button').click(function () { var $this = $(this), $all = $('.difficulty-button'); $all.not($this).toggleClass('active', false).toggleClass('default', true); $this.toggleClass('active', true).toggleClass('default', false); }); Fiddle in action

Categories : Jquery

Adding and Removing Dynamic Buttons From one activity to another activity in android on click of button from previous activity button click
In the first activity's onClick send the data using Intent: intent = new Intent(this, PCode.class); intent.putExtra("EXTRA_BTN_NAME", editText.getText()); intent.putExtra("EXTRA_WHERE", where); startActivity(intent); In the new activity you should get the data with @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activty2); Intent intent = getIntent(); String btnName = intent.getStringExtra("EXTRA_BTN_NAME"); where= intent.getStringExtra("EXTRA_WHERE"); LinearLayout l1 = (LinearLayout) findViewById(R.id.layout); Intent intent1 = new Intent(context1,PCode.class); Button b = new Button(this); b.SetText(btnName); //TODO - use the "where" parameter l1.addView

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.