Solved

jquery event

Posted on 2013-10-27
7
199 Views
Last Modified: 2013-11-28
Hi Experts,

I would ask how to set and catch tab click even using jquery.
Need working example.

Thanks a lot.
0
Comment
Question by:fpoyavo
7 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39603560
Hi,
what type of tab are you refering to?
A jQuery UI tab or the tab of the browser?
0
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39605677
try this:

<body>
<input type="text" id="myInput">
<script type="text/javascript">
    var myInput = document.getElementById("myInput");
    if(myInput.addEventListener ) {
        myInput.addEventListener('keydown',this.keyHandler,false);
    } else if(myInput.attachEvent ) {
        myInput.attachEvent('onkeydown',this.keyHandler); /* damn IE hack */
    }

    function keyHandler(e) {
        var TABKEY = 9;
        if(e.keyCode == TABKEY) {
            this.value += "    ";
            if(e.preventDefault) {
                e.preventDefault();
            }
            return false;
        }
    }
</script>
</body>

Open in new window

0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39606498
Big_Daddy

I asked for jquery tabs click event not TAB key on keyboard.

Thanks.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 33

Expert Comment

by:Big Monty
ID: 39606705
nothing in your original question do you mention jQuery tabs, please be more specific when you're asking questions...

try this:
 $("#tabName" ).tabs({                                                                  
            activate:function(event,ui){                                                       
                            alert(ui.index);                                                   
                    }                                                                          
         });   

Open in new window


this will work for jquery ui 1.10.* or higher
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39684161
I've requested that this question be closed as follows:

Accepted answer: 500 points for The_Big_Daddy's comment #a39606705

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39684160
So why the heck I canot post new questions ? Why you charge me and blocking from asking ?
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question