3

i try to create effect, when someone click option in select option this will show another "select option box" , you can see here http://jsfiddle.net/ruslyrossi/Qxke8/1/ .

The problem is this effect or script only can work with browser mozilla not with chrome or ie.

rusly
  • 1,504
  • 6
  • 28
  • 62

2 Answers2

1

I am not sure if the click event is valid on options. i.e. use 'change' event handler, instead of 'click'.

Try this Working Demo here: http://jsfiddle.net/HVSyC/

Rest should fit your need :)

Further if you keen: Click event on select option element in chrome

Code

var $x = jQuery.noConflict(true);
$x(document).ready(function() {

    $x(".group_tag_dynamic").hide(); //default

    $x("select[name='action_top']").change(function() {

        alert(this.value);
        if(this.value == "Delete")
            $x(".group_tag_dynamic").hide('slow');
        else if(this.value == "Set Under")
            $x(".group_tag_dynamic").show('slow');    

    });

});

​
Community
  • 1
  • 1
Tats_innit
  • 33,991
  • 10
  • 71
  • 77
1
$x(document).ready(function() {
    $x(".group_tag_dynamic").hide(); //default
    $x("select[name=action_top]").change(function() {
        var selectedOption = $x(this).find('option:selected');
        if(selectedOption.hasClass('bulk_action_target'))
            $x(".group_tag_dynamic").show('slow');
        else if(selectedOption.hasClass('bulk_action_delete'))
            $x(".group_tag_dynamic").hide('slow');
    });
});​

fiddle: http://jsfiddle.net/Qxke8/12/

karaxuna
  • 26,752
  • 13
  • 82
  • 117