Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Button / Rotated Buttons


  • Click on any of the buttons to browse the map. The buttons above are rotated using custom CSS code. Here it is:

    "North" Button is not rotated.

    "East" Button
    .mapEast
    {
        top: 190px;
        right: -11px;
        -webkit-transform: rotate(90deg); /* Safari and Chrome */
        -moz-transform: rotate(90deg); /* Firefox */
        -o-transform: rotate(90deg); /* Opera */
        -ms-transform: rotate(90deg); /* IE9 */
    }
    /* Internet Explorer fix */
    .mapEast .EastBtn
    {
        filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
        right: -7px\9;
    }


    "West" Button
    .mapWest
    {
        top: 190px;
        left: -13px;
        -webkit-transform: rotate(270deg); /* Safari and Chrome */
        -moz-transform: rotate(270deg); /* Firefox */
        -o-transform: rotate(270deg); /* Opera */
        -ms-transform: rotate(270deg); /* IE9 */
    }
    /* Internet Explorer fix */
    .mapWest .WestBtn
    {
        filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
        left: 14px\9;
    }


    "South" Button
    .mapSouth
    {
        bottom: 1px;
        right: 395px;
        -webkit-transform: rotate(180deg); /* Safari and Chrome */
        -moz-transform: rotate(180deg); /* Firefox */
        -o-transform: rotate(180deg); /* Opera */
        -ms-transform: rotate(180deg); /* IE9 */
    }
    /* Internet Explorer fix */
    .mapSouth .SouthBtn
    {
        filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
    }


    /* Remove filter in IE9 */
    ._Telerik_IE9 .mapEast .EastBtn,
    ._Telerik_IE9 .mapSouth .SouthBtn,
    ._Telerik_IE9 .mapWest .WestBtn
    {
        filter: none;
    }

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" AutoEventWireup="true" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <style type="text/css">
            /* Map Container Styles */
            .mapContainer
            {
                position: relative;
                width: 880px;
                height: 500px;
                background: url('img/map.jpg') no-repeat left bottom;
            }
            .mapNorth, .mapEast, .mapSouth, .mapWest
            {
                position: absolute;
                height: 22px;
            }
            .mapNorth
            {
                top: 0;
                left: 412px;
            }
            
            .mapEast
            {
                top: 239px;
                right: -11px;
                -webkit-transform: rotate(90deg); /* Safari and Chrome */
                -moz-transform: rotate(90deg); /* Firefox */
                -o-transform: rotate(90deg); /* Opera */
                -ms-transform: rotate(90deg); /* IE9 */
            }
            
            /* Internet Explorer 7 fix */
            *+html .mapEast
            {
                right: 7px;
            }
            
            /* Internet Explorer 6 fix */
            *html .mapEast
            {
                right: 7px;
            }
            
            /* Internet Explorer fix */
            .mapEast .EastBtn
            {
                filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
                right: -7px\9;
            }
            
            .mapSouth
            {
                bottom: 0;
                left: 412px;
                -webkit-transform: rotate(180deg); /* Safari and Chrome */
                -moz-transform: rotate(180deg); /* Firefox */
                -o-transform: rotate(180deg); /* Opera */
                -ms-transform: rotate(180deg); /* IE9 */
            }
            /* Internet Explorer fix */
            .mapSouth .SouthBtn
            {
                filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
            }
            
            .mapWest
            {
                top: 239px;
                left: -13px;
                -webkit-transform: rotate(270deg); /* Safari and Chrome */
                -moz-transform: rotate(270deg); /* Firefox */
                -o-transform: rotate(270deg); /* Opera */
                -ms-transform: rotate(270deg); /* IE9 */
            }
            
            /* Internet Explorer 7 fix */
            *+html .mapWest
            {
                left: -14px;
            }
            
            /* Internet Explorer fix */
            .mapWest .WestBtn
            {
                filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
                left: 13px\9;
            }
            
            /* fixes the rotated button */
            .mapEast .rbSkinnedButton, .mapSouth .rbSkinnedButton, .mapWest .rbSkinnedButton
            {
                padding-right: 3px;
            }
            /* Opera fix - if in a future version the bug is fixed, this hack should be removed */
            @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0)
            {
                .mapEast
                {
                    right: -9px;
                }
            
                .mapWest
                {
                    left: -11px;
                }
            
                .mapSouth
                {
                    bottom: 0;
                }
            }
            /* Safari and Chrome */
            @media screen and (-webkit-min-device-pixel-ratio:0)
            {
                .mapEast
                {
                    right: -13px;
                }
            
                .mapWest
                {
                    left: -16px;
                }
                .mapSouth
                {
                    bottom: 0;
                }
            
                .mapSouth .rbSkinnedButton, .mapWest .rbSkinnedButton
                {
                    padding-right: 2px;
                }
            
                .mapEast .rbSkinnedButton
                {
                    padding-right: 1px;
                }
            }
            
            /* Remove filter in IE9 */
             ._Telerik_IE9 .mapEast .EastBtn,
             ._Telerik_IE9 .mapSouth .SouthBtn,
             ._Telerik_IE9 .mapWest .WestBtn
             {
                 filter: none;
             }
        </style>
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="ScriptManager" runat="server">
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //<![CDATA[
            function moveMap(button, args)
            {
                var divMap = $get("divMap");
                var positions = divMap.style.backgroundPosition.split(' ');
                var x = parseInt(positions[0]) * (-1);
                var y = parseInt(positions[1]) * (-1);

                switch (button.get_text())
                {
                    case "North":
                        if (y > 0)
                        {
                            y = y - 76;
                        }
                        break;
                    case "South":
                        if (y < 456)
                        {
                            y = y + 76;
                        }
                        break;
                    case "West":
                        if (x > 0)
                        {
                            x = x - 48;
                        }
                        break;
                    case "East":
                        if (x < 144)
                        {
                            x = x + 48;
                        }
                        break;
                }

                divMap.style.backgroundPosition = "-" + x + "px " + "-" + y + "px";
            }
            //]]>
        </script>
        <asp:Panel ID="Panel1" runat="server">
            <div id="divMap" class="mapContainer" style="background-position: 0px 0px;">
                <div class="mapNorth">
                    <telerik:RadButton ID="rbNorth" runat="Server" Text="North" ToolTip="Go North"
                        AutoPostBack="false" OnClientClicking="moveMap">
                    </telerik:RadButton>
                </div>
                <div class="mapEast">
                    <telerik:RadButton ID="rbEast" runat="Server" Text="East" CssClass="EastBtn"
                        ToolTip="Go East" AutoPostBack="false" OnClientClicking="moveMap">
                    </telerik:RadButton>
                </div>
                <div class="mapSouth">
                    <telerik:RadButton ID="rbSouth" runat="Server" Text="South" CssClass="SouthBtn"
                        ToolTip="Go South" AutoPostBack="false" OnClientClicking="moveMap">
                    </telerik:RadButton>
                </div>
                <div class="mapWest">
                    <telerik:RadButton ID="rbWest" runat="Server" Text="West" CssClass="WestBtn"
                        ToolTip="Go West" AutoPostBack="false" OnClientClicking="moveMap">
                    </telerik:RadButton>
                </div>
            </div>
        </asp:Panel>
        <qsf:Footer runat="server" ID="Footer1" ShowCodeViewer="true" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451