0

I have three javascript/jquery scripts and I need all of them. I am new in jquery so not able to add all three scripts. If I do all then one of them do not work. I need to put all three scripts into one.

<script type="text/javascript">
$(function(){

    // off

    $("#pgfor").twoitems({
        header: false
    });


    // off

    $("#city").single({
        header: false
    });


    // default
    $("#locality").multiselect({
        header: true
    });


    // off
    $("#roomtype").twoitems({
        header: false
    });


    // off
    $("#pricetype").twoitems({
        header: false
    });


    // off
    $("#price_value").multiselect({
        header: false
    }); 

});
</script>


<script type="text/javascript">
$(document).ready(function($){
    $('#mega-menu-tut').dcMegaMenu({
        rowItems: '3',
        speed: 'fast'
    });
});
</script>


<script>
        $(document).ready(function() {

            $('a[id^="edit"]').fancybox({
                'width'             : '48%',
                'height'            : '82%',
                'autoScale'         : false,
                'transitionIn'      : 'none',
                'transitionOut'     : 'none',
                'type'              : 'iframe',
                onClosed    :   function() {
                    parent.location.reload(true); 
                }
            });

            $('a[id^="icard"]').fancybox({
                'width'             : '40%',
                'height'            : '40%',
                'autoScale'         : false,
                'transitionIn'      : 'none',
                'transitionOut'     : 'none',
                'type'              : 'iframe',
            });

            $('a[id^="upload"]').fancybox({
                'width'             : '40%',
                'height'            : '40%',
                'autoScale'         : false,
                'transitionIn'      : 'none',
                'transitionOut'     : 'none',
                'type'              : 'iframe',
            });

            $('a[id^="delete"]').fancybox({
                'width'             : '20%',
                'height'            : '20%',
                onStart     :   function() {
                    return window.confirm('Do you want to delete?');
                },
                onClosed    :   function() {
                    parent.location.reload(true); 
                }


            });

        });
    </script>

Edited by diafol: Not PHP - Move to Javascript

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by pritaeas
0

Are you saying this doesn't work?

<script type="text/javascript">
  $(document).ready(function() {
    $("#pgfor").twoitems({header: false});
    $("#city").single({header: false});
    $("#locality").multiselect({header: true});
    $("#roomtype").twoitems({header: false});
    $("#pricetype").twoitems({header: false});
    $("#price_value").multiselect({header: false}); 

    $('#mega-menu-tut').dcMegaMenu({rowItems: '3', speed: 'fast'});

    $('a[id^="edit"]').fancybox({
        'width'             : '48%',
        'height'            : '82%',
        'autoScale'         : false,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'type'              : 'iframe',
        onClosed    :   function() {
            parent.location.reload(true); 
        }
    });

    $('a[id^="icard"]').fancybox({
        'width'             : '40%',
        'height'            : '40%',
        'autoScale'         : false,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'type'              : 'iframe'
    });

    $('a[id^="upload"]').fancybox({
        'width'             : '40%',
        'height'            : '40%',
        'autoScale'         : false,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'type'              : 'iframe'
    });

    $('a[id^="delete"]').fancybox({
        'width'             : '20%',
        'height'            : '20%',
        onStart     :   function() {
            return window.confirm('Do you want to delete?');
        },
        onClosed    :   function() {
            parent.location.reload(true); 
        }
    });

  });
</script>

Edited by pritaeas

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.