"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Showing posts with label Jquery. Show all posts
Showing posts with label Jquery. Show all posts

Monday, November 11, 2013

button click event not fire from jquery dialog

button click event not fire from JQUERY dialog


Its a common issues.the defalut value of button property "UseSubmitBehavior" is true.

That expresses the button will use the browser's submit mechanism. However, jQuery Dialog UI is manipulating it.

There exists a conflict. If you want to fired the button click event. Please set its property "UseSubmitBehavior" as false.

<asp:Button ID="Button1" runat="server" Text="Button"  UseSubmitBehavior="false" OnClick="Button1_Click" />


If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)

Monday, February 18, 2013

Thursday, February 7, 2013

decrypt a string in javascript which encrypted in c#

encrypted in string in c# and decrypt that in JavaScript


Code behind  
protected void Page_Load(object sender, EventArgs e)
    {
        Hdn.Value = "sdsd".EncodeTo64();
    }

Wednesday, February 6, 2013

auto resize jquery ui dialog box



$('#AddStage').dialog({ modal: true, "width": "auto" });


"width""auto"
don't forgot to all necessary js and css files

If u had any trouble just ask, Happy to help u :)
Stay Tune... Have a nice day... 'N happy Coding :)

Sunday, February 3, 2013

Moving focus around the table in Jquery

Last week i answered a question in a fourm ( http://forums.asp.net/p/1877841/5281857.aspx/1?How+can+I+move+the+focus+around+my+html+table+ ) to move focus around the cells in a table using jquery . i go with keypress event. below it goes.

Friday, February 1, 2013

addition operation in Grid inside the text box using javascript

Having addition operation on gridview in JavaScript.


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

Tuesday, January 29, 2013

Changing image within Gridview programatically

Simple RowdataBound event isit? an alternate if it reduce memory load and time. wht abt that :)
Yup by jquery :)

Sunday, January 20, 2013

Enable and Disable Regular field validation using javascript



  Enable and Disable Regular field validation using javascript

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.9.0.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txt01" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txt01"
            CssClass="val" EnableClientScript="true" runat="server" ErrorMessage="errro"></asp:RequiredFieldValidator>
        <asp:Button ID="btnEnable" CssClass="enb" runat="server" Text="Enable validation" />
        <asp:Button ID="btnDisable" runat="server" CssClass="Dis" Text="Disable Validation" />

Thursday, January 10, 2013

Shuffle div in jquery


Hi, 

Shuffle div in jquery 

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .span1
        {
            width: 228px;
            background-color: #2D89EF !important;
            height: 63px;
            float: left;
            cursor: pointer;
        }
        .span2
        {
            width: 228px;
            background-color: #00A300 !important;
            height: 63px;
            float: left;
            cursor: pointer;
        }
        .span3
        {
            width: 228px;
            background-color: #FFC40D !important;
            height: 63px;
            float: left;
            cursor: pointer;
        }
        .span3:hover
        {
            cursor: pointer;
        }
        .place-right
        {
            float: right !important;
            margin-left: 10px;
        }
        .fg-color-white
        {
            color: #FFFFFF !important;
        }
    </style>
    <script src="Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            shuffle();
        });
        function shuffle() {               // pass the divs to the function
            var e = $('#shuffle div');
            var replace = $('<div>');
            var size = e.size();

            while (size >= 1) {
                var rand = Math.floor(Math.random() * size);
                var temp = e.get(rand);      // grab a random div from our set
                replace.append(temp);        // add the selected div to our new set
                e = e.not(temp); // remove our selected div from the main set
                size--;
            }
            $('#shuffle').html(replace.html());     // update our container div with the
            // new, randomized divs
        }
        setInterval(shuffle, 2000);
  
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width: 550px">
        <div id="shuffle">
            <div id='d1' class="span1">
                <img class="place-right" style="margin: 10px;" src="images/simple.png" />
                <h2 class="fg-color-white">
                    D1</h2>
            </div>
            <div id='d2' class="span2">
                <img class="place-right" style="margin: 10px;" src="images/grid.png" />
                <h2 class="fg-color-white">
                    D2</h2>
            </div>
            <div id='d3' class="span3">
                <img class="place-right" style="margin: 10px;" src="images/responsive.png" />
                <h2 class="fg-color-white">
                    D3</h2>
            </div>
            <div id='Div1' class="span1">
                <img class="place-right" style="margin: 10px;" src="images/simple.png" />
                <h2 class="fg-color-white">
                    D1</h2>
            </div>
            <div id='Div2' class="span2">
                <img class="place-right" style="margin: 10px;" src="images/grid.png" />
                <h2 class="fg-color-white">
                    D2</h2>
            </div>
            <div id='Div3' class="span3">
                <img class="place-right" style="margin: 10px;" src="images/responsive.png" />
                <h2 class="fg-color-white">
                    D3</h2>
            </div>
            <div id='Div4' class="span1">
                <img class="place-right" style="margin: 10px;" src="images/simple.png" />
                <h2 class="fg-color-white">
                    D1</h2>
            </div>
            <div id='Div5' class="span2">
                <img class="place-right" style="margin: 10px;" src="images/grid.png" />
                <h2 class="fg-color-white">
                    D2</h2>
            </div>
            <div id='Div6' class="span3">
                <img class="place-right" style="margin: 10px;" src="images/responsive.png" />
                <h2 class="fg-color-white">
                    D3</h2>
            </div>
        </div>
    </div>
    </div>
    </form>
</body>
</html>


To see the demo check out the menu of this blog

If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)

Monday, January 7, 2013

Turn off autocomplete for textbox in ASP.Net using jQuery

Turn off auto-complete for text-box in ASP.Net using jQuery

Its all about handling autocomplete attribute,It can be done by javascript or implicit given as false

Friday, January 4, 2013

return false; is NOT working [Resolved]

return false; is NOT working

Its a common error while handling logic operation in JavaScript.
Here i'm listing a few reason 

Here chkduplicate() is my function

Wednesday, January 2, 2013

Print Google Maps

Print Google Maps 


To print google maps you have to use the Google Static Maps API if you want printer friendly maps.

It should be pretty easy to build the Static Maps API URL request string from the LatLng or your markers. One caveat is that the URL is limited to 2048 characters including any character escapes, this will limit how many markers you can have on the map at one time.

In the Javascript API, markers have the class 'gmnoprint', which disables them from showing up on the printed rendering. You can iterate through the markers and remove this class, which should allow them to be printed on the page. As far as I know, this will not work for the direction lines.

Tuesday, July 3, 2012

Show loading icon while actual image is loading using jQuery

Showing loading for ajax content is pretty common thing but suppose there is a quite big image (in size) on your page and it is taking lots of time to load. Would it not be nice to show loading icon for the same? Well, it creates a nice user experience. The user will come to know that something is loading. So in this post, I will show you how to show loading icon while actual image is loading using jQuery.

Monday, July 2, 2012

Spin plugin to show loading icon with jQuery

 Hi *.*,


Web pages takes time to load and when page is heavy then it takes more time to load. Would it not be nice to show loading icon. It creates responsive webpage and gives nice user experience.In this post, I will show you a plugin to show loading icon.

Features

    No images, no external CSS
    No dependencies (jQuery is supported, but not required)
    Highly configurable
    Resolution independent
    Uses VML as fallback in old IEs
    Uses @keyframe animations, falling back to setTimeout()
    Works in all major browsers, including IE6
    MIT License

How to use it?

var opts = {
  lines: 13, // The number of lines to draw
  length: 7, // The length of each line
  width: 5, // The line thickness
  radius: 21, // The radius of the inner circle
  rotate: 90, // The rotation offset
  color: '#000', // #rgb or #rrggbb
  speed: 2, // Rounds per second
  trail: 93, // Afterglow percentage
  shadow: false, // Whether to render a shadow
  hwaccel: false, // Whether to use hardware acceleration
  className: 'spinner', // The CSS class to assign to the spinner
  zIndex: 2e9, // The z-index (defaults to 2000000000)
  top: 'auto', // Top position relative to parent in px
  left: 'auto' // Left position relative to parent in px
};
var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);

The spin() method creates the necessary HTML elements and starts the animation. If a target element is passed as argument, the spinner is added as first child and horizontally and vertically centered.

Manual positioning

By default the spinner is centered within the target element. Alternatively you may specify a top and left option to position the spinner relative to the target element.

Hiding the spinner

To hide the spinner, invoke the stop() method, which removes the UI elements from the DOM and stops the animation. Stopped spinners may be reused by calling spin() again.

Browser Compatibility

    Chrome
    Safari 3.2+
    Firefox 3.5+
    IE 6,7,8,9
    Opera 10.6+
    Mobile Safari (iOS 3.1+)
    Android 2.3+


Download Plugin : http://fgnass.github.com/spin.js/dist/spin.min.js


If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)

Friday, June 15, 2012

get count of number of elements were selected by jQuery

jQuery selector returns a jQuery object that has .lenght property. So the easiest way to get the length is using the .lenght property.

var iCount = $('.cssClass').length;

If you want to know how many div elements present on the page then,

var eCount = $('div').length;



jQuery also provides .size() method, which also does the same thing as the .lenght property. But the .lenght property is preferred because it does not have the overhead of a function call.

If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)