Solved

jquery event

Posted on 2013-10-27
7
195 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 32

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
DevOps Toolchain Recommendations

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

 
LVL 32

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
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 the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now