सरल उदाहरण पृष्ठ पर एक div स्लाइड करने के लिए:
<asp:Panel id="MovingContent" runat="server"
style="position:absolute;left:-100px;top:20px;height:40px;width:100px;">
The content that will move
</asp:Panel>
<script type="text/javascript">
//Initial position
//(should be the same as the position specified in the element's style)
posX = -100;
posY = 20;
//Position where the element will stop
targetX=200;
targetY=60;
function move(){
if(posX < targetX){
posX += 10;
if(posY < targetY) posY += 1;
var divElement = document.getElementById('<%=MovingContent.ClientID%>');
divElement.style.left = posX + 'px';
divElement.style.top = posY + 'px';
//Time in milliseconds to when to move next step
self.setTimeout('move()', 100);
}
}
move(); //Start the moving
</script>
आप इसे अपनी जरूरतों में सुधार सकते हैं, लेकिन इसका उपयोग मूलभूत विचार के रूप में किया जा सकता है कि इसे कैसे किया जाए।
त्रुटि नाम 'MovingContent' वर्तमान संदर्भ \t ई में मौजूद नहीं है: \ Hemaa \ फार्म \ welcome.aspx इस त्रुटि – TinTin
मैं बस ठीक करने के लिए संपादित किया है मिल गया कीड़े। पुनः प्रयास करें। मैंने तय की गई अंतिम त्रुटि 'ClientId => ClientID' बदल रही थी। अब यह काम करना चाहिए (मैंने अब इसका परीक्षण किया है ...) – awe
मुझे पृष्ठ को चलाने के बाद मेरे पृष्ठ में कुछ भी नहीं मिल रहा है। – TinTin