JSFiddle

  • check a driopdown values exists in jquery

    check a driopdown values exists in jquery

    $(function(){
    var checkVal='1';
      $('#Liste option').each(function(){
          if (this.value == checkVal) {
          	console.log(checkVal+ ' is found!');
          }
      });
    });
    
  • regex - two part number, not ending with dot or comma #2 is the latest revision

    regex - two part number, not ending with dot or comma

    
    var myReg = /^\d+(?:[.,]\d+)?$/;
    console.log(myReg.exec("123"));
    console.log(myReg.exec("123.123"));
    console.log(myReg.exec(".123 ...
  • infinite loop in jQuery

    infinite loop in jQuery

    var width = $(document).width() - $('#mydiv').width();
    $(document).ready(function() {
    
        function animateMydiv() {
            $('#mydiv').animate({
                    'left': width + 'px'
                }, 9000,
    
                function() {
                    $('#test').css ...
  • Change the ID of an element dynamically

    Change the ID of an element dynamically

        $(document).on('click', ".nuttonA",function(){
            alert("nuttonA is clicked "); 
            $("#buttonB").attr("id","notButtonB");
        });
    
        $(document).on('click', "#notButtonB",function(){
            alert("notButtonB ...
  • Count occurrences of array in string variable and return length

    Count occurrences of array in string variable and return length

    var search = ["ab", "cd", "ef"];
    var string = "ab yz cd wx ef uv ab yz cd";
    
    console.log(
      search.map ...
  • Horizontal UI in html css3

    Horizontal UI in html css3

    <div id="navcontainer">
    <ul>
    <li><a href="#">Milk</a></li>
    <li><a href="#">Eggs</a></li>
    <li><a href="#">Cheese</a></li>
    <li><a href="#">Vegetables</a></li>
    <li><a href="#">Fruit</a></li>
    </ul>
    </div>
  • HighChart Exporting In Client Side #7 is the latest revision

    In this was you can avoid the hit going to http://export.highcharts.com/ while exporting in highchart

    $(function () {
        $('#myChart').highcharts({
            credits: {
                enabled: false
            },
            exporting: {
                chartOptions: {
                    plotOptions: {
                        series: {
                            dataLabels: {
                                enabled: true
                            }
                        }
                    }
                },
                scale: 3,
                fallbackToExportServer: false
            },
            title: {
                text: 'My ...
  • Highcharts Demo

    author(s): Øystein Moseng

    $(function () {
    
        $('#container').highcharts({
    
            exporting: {
                chartOptions: { // specific options for the exported image
                    plotOptions: {
                        series: {
                            dataLabels: {
                                enabled: true
                            }
                        }
                    }
                },
                scale: 3,
                fallbackToExportServer: false ...
  • Highcharts Demo

    author(s): Torstein Hønsi

    $(function () {
    
        $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=world-population-density.json&callback=?', function (data) {
    
            // Initiate the chart
            $('#container').highcharts('Map', {
    
                title : {
                    text : 'Get axis extremes'
                },
    
                colorAxis: {
                    min: 1,
                    max: 1000,
                    type: 'logarithmic'
                },
    
                series : [{
                    data : data,
                    mapData: Highcharts.maps['custom/world'],
                    joinBy: ['iso-a2', 'code'],
                    name: 'Population density',
                    states: {
                        hover: {
                            color: '#BADA55'
                        }
                    },
                    tooltip: {
                        valueSuffix: '/km²'
                    }
                }]
            });
        });
    
        $('#getextremes').click(function () {
            var chart = $('#container').highcharts ...
  • Highcharts Demo #3 is the latest revision

    author(s): Torstein Hønsi

    $(function () {
    
        // create the chart
        $('#container').highcharts({
            chart: {
                events: {
                    selection: function (event) {
                        var text,
                            label;
                        if (event.xAxis) {
                            text = 'min: ' + Highcharts ...