How can I get this code to change the background color every other click?

时间:2015-05-12 22:41:18

标签: javascript jquery

The div tag referred to is the only code that I added to the HTML text. If possible please provide your answer in just jquery. $(document).ready(function(){ $("div").click(funcOne(), funcTwo());

io.gatling.core.runner.Runner

5 个答案:

答案 0 :(得分:1)

.../detail.html?id=42

答案 1 :(得分:0)

Try this:

Chapter: 486
Section: 380

      CH.   ART.  SEC.
Split 486 | 000 | 0380 | 1

// PHP code
$files = scandir('stathtml/');
    foreach ($files as $file) {

        // Change this to a split function and then echo certain parts
        // of it out to test.
        echo $file . "<br>";

    }

Have you seen the explorer event listener? I think the problem is that toggle is not for call like an event for clic, it is used to show or hide an element from the dom.

答案 2 :(得分:0)

In newer jQuery versions td cannot be used any more for toggling two callback functions. It's used as a simple .toggle() shorthand.

Toggle two colors using .show() / .hide():

Array.reverse()

More about toggling two functions: https://stackoverflow.com/a/21520499/383904

答案 3 :(得分:0)

To answer your question of 'every other click'.

super.paintComponent

答案 4 :(得分:0)

I can't give you JQuery, but I can give a vanilla solution:

C:\Users\admin\Downloads\hbase-1.0.1>bin\start-hbase.cmd
Error: Could not find or load main class " "
ERROR: Could not determine the startup mode.

This method has worked for me before and (the few times I've tried) the toggle() method has been a bit of a flop. So convert the above to JQuery and just run two (or more) click()'s in sequence.

If you want the color to change only on certain clicks, place the event listener add/remove (in funcOne() ) inside a counter that iterates every time funcOne occurs. Attach the counter to a variable, and when the counter = N (where n = the size of each interval in clicks), change the event listeners and reset the counter.

相关问题