ラベル position の投稿を表示しています。 すべての投稿を表示
ラベル position の投稿を表示しています。 すべての投稿を表示

2012年3月28日水曜日

Reset scroll after call back

Hi,

How do I reset the scroll position of the page when a call back has returned?

Cheers, WT.

http://aspnet.4guysfromrolla.com/articles/111704-1.aspx

assign using client side script

document.body.scrollLeft = 0;

document.body.scrollTop = 0

Re-Setting an Object to its original position using Animation Extender

Hi

I have been working on a nice ajax menu using the Animation Extender. Basically, i have a series of GIF's. When the mouse hovers over a gif, the gif moves 6px to the right. When the mouse hovers out, the gif moves 6px to the left.

Everything works well, if you let the whole animation run through. But if you where to move your mouse off and on the gif a few times in a short period, the gif would actually lose its original position and end up either further left or further right to where it should.

I spose what I am trying to get at is, is it possible to reset an objects original position?

Here is a sample of my extender:

<cc1:AnimationExtender ID="AnimationExtender3" runat="server" TargetControlID="btnPro">
<Animations>
<OnHoverOver>
<Move duration=".03" fps="50" horizontal="6" unit="px"/>
</OnHoverOver>
<OnHoverOut>
<Move duration=".03" fps="50" horizontal="-6" unit="px"/>
</OnHoverOut>
</Animations>
</cc1:AnimationExtender>

Thanks for your help in advance.

Hugh

Would any one have an easier way of doing this?

Thanks

Hugh


HI ,

try this link :

Scripting Animations from the Ms Ajax AnimationExtender

Hope this heps


Thanks for the link.

This would be perfect for wat i am trying to do. Problem is i cant seem to get it to work on a hover over event, instead of a click event.

Any ideas?

Thanks

Hugh

Resetting Scroll Position on AJAX partial postbacks

I'm sure someone has seen this one before:

    I have a grid inside an UpdatePanel displaying data that requires users to scroll to see the last couple of rows

    When a user selects a row in the grid, and AJAX post fires and displays data at the top of the page, but the scroll position is maintained and the user is required to scroll up to to the top of the page manually.

I need to reset the scroll position to 0,0 when a record is selected in my grid. If anyone can shed some light on this one I would greatly appreciate it.

Thanks

PS

Please see my post here:

http://forums.asp.net/t/1196152.aspx


Thank you - perfect solution, and so little code. I knew it wouldn't take much.

Resize animation with RoundedCorners

I have

<div id="div2" runat="server" style='width: 300px; height: 200px; background-color: teal; position: absolute;'>

and

<cc2:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server">
<cc2:RoundedCornersProperties Radius="10" TargetControlID="div2"></cc2:RoundedCornersProperties>
</cc2:RoundedCornersExtender>

and

<cc2:AnimationProperties TargetControlID="div1">
<Animations><OnHoverOver>
<Resize AnimationTarget="div2" Width="500" Height="400" />
</OnHoverOver></Animations>
</cc2:AnimationProperties>

and when i hover over div1... only width changes. A bug?

Hi MarekG,

This is a consequence of the way that RoundedCorners works. It will wrap your target control in another div and set the height of the new div to be the same. If the inner height changes it won't propogate to the containing wrapper (i.e. you're resizing the wrapped control, but it's overflow is hidden by its wrapper so you see nothing happen).

Right now there isn't a way to work around this - but I hope to make some modifications to the Animation framework on the next release that will allow you to side step the issue.

Thanks,
Ted

2012年3月26日月曜日

Restore position of a modal panel after postback

There is a modal panel which was created with the help of a modalPopupExtender. There is also an updatePanel and a GridView on it. Selecting a row in the GridView raises postback what sets the position of modal panel to default value (center of the screen). How to restore position at the moment of postback?

Hi,

According to your problem, I think you may keep the position of the modalPopup in two hiddenfileds outside UpdatePanelbefore postback, and set the popup's position to those values in hiddenFields inendRequest event handler.

For instance:

function beginRequestHandler()
{
$get("hfX").value = $find('behaviorIDOfModalPopup').get_X();
$get("hfY").value = $find('behaviorIDOfModalPopup').get_Y();
}

function endRequestHandler()
{
$find('behaviorIDOfModalPopup').set_X($get("hfX").value);
$find('behaviorIDOfModalPopup').set_Y($get("hfY").value);
}

Hope this helps.


Thanks,

There is one more solution:

function BeginRequest(sender, args) { var s = $get('Panel1').style.left; $find('ModalPopupExtender1').set_X(s.substring(0, s.length - 2)); s = $get('Panel1').style.top; $find('ModalPopupExtender1').set_Y(s.substring(0, s.length - 2)); }