Web Forms :: Pan On Image Button?

Dec 6, 2010

I am using image button to display a map on it.My task was to zoom in,zoom out and pan.

Zoomin and zoomout are done but i dont knw how to pan on image button.I got a java script for pan:

<script type="text/javascript">
var imgStartLoc = null;
document.onmousemove = mouseMove;
document.onmouseup = mouseUp;
var dragObject = null;
var mouseOffset = null;
function mouseCoords(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
function getMouseOffset(target, ev){
ev = ev || window.event;
var docPos = getPosition(target);
var mousePos = mouseCoords(ev);
return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
}
function getPosition(e){
var left = 0;
var top = 0;
while (e.offsetParent){
left += e.offsetLeft;
top += e.offsetTop;
e = e.offsetParent;
}
left += e.offsetLeft;
top += e.offsetTop;
return {x:left, y:top};
}
function mouseMove(ev) {
ev = ev || window.event;
var mousePos = mouseCoords(ev);
if(dragObject){
dragObject.style.position = 'absolute';
dragObject.style.top = mousePos.y - mouseOffset.y;
dragObject.style.left = mousePos.x - mouseOffset.x;
return false;
}
}
function mouseUp(){
dragObject = null;
}
function try_abc(){
makeDraggable(document.getElementById("ibMap1"));
}
function makeDraggable(item){
if(!item) return;
item.onmousedown = function(ev){
dragObject = this;
mouseOffset = getMouseOffset(this, ev);
return false;
}
}

This code works fine if i use <img> tag instead of imagebutton.But I have to implement panning on image button only.

View 6 Replies


Similar Messages:

AJAX :: Image Button In Datalist ItemTemplate And Image Button Click Call Editor

Apr 23, 2012

Image Button in Datalist it ItemTemplate and Image Button Click Call Editor(Ajax)

View 1 Replies

Forms Data Controls :: Changing Image In Image Button Column In A Datagridview?

Oct 21, 2010

Just wondering if anyone has ever managed to find a way to have a datagridview image button column in a template field which display different images on different rows depending on some data element in the row. Our application needs to display a series of fees charged against an account column which will be either less then 500, 500 to 1000 or >1000. Some of those fees are charged at a full rate, others at a partial rate, and some are not charged at all. The user would like to see a simple 3-state graphic which would convey the simple info: full-charge, partial-charge, or no-charge. Sounds easy enough but I've not yet managed to find a way to do this. Every time I attempt to modify the individual cell's graphic it seems to want to change the graphic for all the rows.

View 3 Replies

Forms Data Controls :: Change The Image Url Of An Image Button In Gridview

Jan 7, 2010

I am trying to change the image url of an image button in my gridview. I cannot seem to be able to do this in the code behind. Is there a way I can do this through the image buttons controls?

View 5 Replies

Forms Data Controls :: Assign The Image URL From MS Acsess To Image Button In C#?

Jun 21, 2010

I am new to .NEt, I am doing a classifieds website and tried to save the image in server,in a seperate folder and stored that address in MS access databse.when I wanted to display that image in a gridview,its not showing the image.

In the seperate column when Ia m trying to see the image location using bound field,its displaying C:websitesAzangouser_images j.jpg, but where as its not showing the image in the item template field.

[code]....

View 5 Replies

Web Forms :: Disable Image Button Or Hyperlink Button Based On Role

Feb 14, 2011

I have four Imagebuttons that I want to disable depending on the Role the user belongs too. I know how do do this in a gridview or detailsview but for some reason it isn't working on just a plain form. So when a User who is not in the "Admin" role logs onto the page he either doesn't see the button or the hyperlink has been disabled thus not allowing him to proceed any further.

View 6 Replies

Web Forms :: Disable Image Rollover Button When Button Clicked

Feb 10, 2011

[Code]....

View 2 Replies

Web Forms :: Retrieve Image From DB On Image Button?

May 25, 2012

i want to retrieve images from sql server on group of image buttons

View 1 Replies

Web Forms :: Making An Image Button Look Like A Toggle Button?

Aug 2, 2010

Is there a way to make an image button look like a toggle button? I want it to specify the image for checked and unchecked state. Either that, even if it doesn't look like a button, I'd still want to use custom images instead of the standard dot inside a hole.

View 4 Replies

Dynamically Generate Image On Image Map Or Image Button?

Sep 30, 2010

Here is this thing which to me looks possible, but when I searched over the net I couldnt find anything.

I want to create a page where I can upload an image using any upload function and then display it. Now after diplaying it I want to select the hotspots for an image map. The coordinates of image map values are stored in a database.

Basically I want that to create image maps and hotspots I dont use any offline software, this work is successfully completed and working perfectly, but i want generate one identification where i click the hot spots position in image or CSS file Generate for user identifications, So how can i solve this problem.

I hope You are clear in that what I am looking for.

View 1 Replies

Vb.net - How To Create A Toggle Button Using .net Image Button

Dec 30, 2010

i want to do it without page refresh .....

Protected Sub s1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles s1.Click
If s1.ImageUrl = "~/selected.gif" Then
s1.ImageUrl = "~/available.gif"
TextBox1.Text = TextBox1.Text.Replace("1", "")
ElseIf s1.ImageUrl = "~/available.gif" Then
s1.ImageUrl = "~/selected.gif"
[code]...

View 2 Replies

Web Forms :: Onclick For Image Button?

Feb 25, 2011

I had a button with onclick event (in .aspx page)

<input
class="Button"
type="button"
onclick="top.location='<%=string.Format("MyAccount.aspx?action=new&returnUrl={0}",
Web.ProcessFlow.Common.QueryString(Request.QueryString["returnUrl"]))%>'"
value="New
Customer Registration"
/>

I have converted this button to image button like this:

<asp:ImageButton
ID="ImageButton1"
runat="server"
ImageUrl="../Images/checkout/Proceed_To_Checkout_Button.png"
onclick="top.location='<%=string.Format("MyAccount.aspx?action=new&returnUrl={0}",
Web.ProcessFlow.Common.QueryString(Request.QueryString["returnUrl"]))%>'"
/>

It is not working and It gave me an error.

View 6 Replies

Web Forms :: Mouseout For Image Button

Aug 12, 2010

ImageButton1.Attributes.Add("onmouseout", "this.src='Images/cooltext466514263.png'");ImageButton1.Attributes.Add("onmouseover", "this.sr c = 'Images/chat2.png'");

First image is "documents.png". It doesn't seem to be working.

What must I do to "revert" it back to the original image which is documents.png?I have tried to add documents.png to the attributes for onmouseover and it doesn't work. When I tried using other images, doesnt seem to work also.

View 2 Replies

Web Forms :: Making Button With Text And Image In 3.5?

Mar 11, 2010

i want asp button or imagebuttom with both background image and text above button.

i dont want to write text directly on image.

View 4 Replies

Web Forms :: How To Set Multiple Button In Single Image

Aug 23, 2010

I need to make multiple button in a single image in asp.net.and need coding also for vb.net.

View 4 Replies

Web Forms :: Dynamic Image Button Does Not Work

Feb 5, 2010

[code]....

Dynamic image button does not work

View 7 Replies

Web Forms :: Adding Attributes To An Image Button?

Jan 3, 2011

I just want to add and attribute called "pubID" to an image button with the value I give it and then call that value on the image button click event. This image button was created dynamically as well. At the moment this code is not working. When debugging it looks like Pubid is getting assigned a value but on the click event, the attribute isn't being retrieved correctly.

--added attribute

[Code]....

View 3 Replies

Web Forms :: Image Not Loading In Link Button

Jan 6, 2010

image is not loading in my link button in firefox

<asp:Image ID="Image1" ImageUrl="~/Images/bird.bmp" runat="server" />

View 3 Replies

Web Forms :: Using Image Button In But Unable To Stop It?

Jan 8, 2010

Im using a image button in my usercontrol to avoid postbacks on its click event.but im unable to stop it .

This usercontrol will be loaded into an ASP page on its load.

<input type="image" src="../Images/plus.gif" onclick="addElement(TopFrame1_PnlAxnCds1,TopFrame1$ddlMitigtAxnCd11);" name="AddMore"/>

View 3 Replies

Web Forms :: Set A Background Image To The Button In Aspx?

Jun 30, 2010

How to set an background image to the button in asp.net 2005.

I am not able to find any attribute where i can set the image.

View 15 Replies

Web Forms :: Forcing An Asp:Button To Display An Image?

Feb 18, 2010

Before you say use an ImageButton, this is not an option. I only have access to the client side right now.

View 1 Replies

Web Forms :: Create A Button With Image And Text?

Sep 29, 2010

Currently I have button on a form and I need to make buttons image but maintain the click event functions that they have. For instance I have a button that says Update. Is there a way to add an image and put text in that image that says Update and maintain it's functionality. here is the code for the button:

[Code]....

View 2 Replies

Web Forms :: Image In Radio Button List?

Jul 19, 2010

I want to insert images in each radio in radio buttonlist.How can i do that ?

View 3 Replies

Web Forms :: Change Image Button Picture?

May 2, 2012

I have 2 image button in my page

1-Imagebutton1

2-imagebutton2

I want when click on Imagebutton1 both of my image button picture  (Imagebutton1  and imagebutton2) will be change .

View 1 Replies

Web Forms :: Open In A New Tab On Image Or Link Button

Aug 27, 2012

I want when any user right click on Image button or link button on my website at that time I want him to show open in a new tab.

The event has been created on Datalist_Itembound event and from their I am redirecting user to another window.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved