محدوده حرکت این اسکریپ رو برام درست کنید تعداد بازدیدvisits : 1041
|
|||||||||
raveh123
![]() ![]() ![]()
|
محدوده حرکت این اسکریپ رو برام درست کنید
سلام این اسکریپ رو دارم میخوام محدود حرکتش درhight=299 باشه کسی میتونه کمکم کنه؟ اینم اسکریپش کد: // JavaScript Document $(document).ready(function(){ animateDiv();
}); function makeNewPosition(){
// Get viewport dimensions (remove the dimension of the div) var h = $(\"#con\").height() 10; var w = $(\"#con\").width() 10;
var nh = Math.floor((Math.random()*10) * h); var nw = Math.floor((Math.random()*10) * w);
return [nh,nw];
} function animateDiv(){ var newq = makeNewPosition(); var oldq = $(\'.a\').offset(); var speed = calcSpeed([oldq.top, oldq.left], newq);
$(\'.a\').animate({ top: newq[0], left: newq[1] }, speed, function(){ animateDiv(); });
}; function calcSpeed(prev, next) {
var x = Math.abs(prev[1] - next[1]); var y = Math.abs(prev[0] - next[0]);
var greatest = x > y ? x : y;
var speedModifier = .1; var speed = Math.ceil(greatest/speedModifier); return speed; } $(document).ready(function() { $(\'.move\').hover(function() { //mouse in $(this).animate({ paddingTop: \'0px\' }, 200); }, function() { //mouse out $(this).animate({ paddingTop: \'10px\' }, 100); }); }); var WIDTH; var HEIGHT; var canvas; var con; var g; var pxs = new Array(); var rint = 60; $(document).ready(function(){ WIDTH = window.innerWidth; HEIGHT = window.innerHeight; $(\'#container\').width(WIDTH).height(HEIGHT); canvas = document.getElementById(\'pixie\'); $(canvas).attr(\'width\', WIDTH).attr(\'height\',HEIGHT); con = canvas.getContext(\'2d\'); for(var i = 0; i < 50; i ) { pxs = new Circle(); pxs.reset(); } setInterval(draw,rint);
}); function draw() { con.clearRect(0,0,WIDTH,HEIGHT); for(var i = 0; i < pxs.length; i ) { pxs.fade(); pxs.move(); pxs.draw(); } } function Circle() { this.s = {ttl:9000, xmax:5, ymax:2, rmax:20, rt:10, xdef:90, ydef:50, xdrift:4, ydrift: 4, random:true, blink:true}; this.reset = function() { this.x = (this.s.random ? WIDTH*Math.random() : this.s.xdef); this.y = (this.s.random ? HEIGHT*Math.random() : this.s.ydef); this.r = ((this.s.rmax-1)*Math.random()) 1; this.dx = (Math.random()*this.s.xmax) * (Math.random() < .5 ? -1 : 1); this.dy = (Math.random()*this.s.ymax) * (Math.random() < .5 ? -1 : 1); this.hl = (this.s.ttl/rint)*(this.r/this.s.rmax); this.rt = Math.random()*this.hl; this.s.rt = Math.random() 1; this.stop = Math.random()*.2 .4; this.s.xdrift *= Math.random() * (Math.random() < .5 ? -1 : 1); this.s.ydrift *= Math.random() * (Math.random() < .5 ? -1 : 1); } this.fade = function() { this.rt = this.s.rt; } this.draw = function() { if(this.s.blink && (this.rt = this.hl)) this.s.rt = this.s.rt*-1; else if(this.rt >= this.hl) this.reset(); var newo = 1-(this.rt/this.hl); con.beginPath(); con.arc(this.x,this.y,this.r,0,Math.PI*2,true); con.closePath(); var cr = this.r*newo; g = con.createRadialGradient(this.x,this.y,0,this.x,this.y,(cr WIDTH || this.x < 0) this.dx *= -1; if(this.y > HEIGHT || this.y < 0) this.dy *= -1; } this.getX = function() { return this.x; } this.getY = function() { return this.y; } } $(function(){ $(\'#a a\') .css( {backgroundPosition: \"3px -35px\"} ) .mouseover(function(){ $(this).stop().animate({backgroundPosition:\"(3px 0px)\"}, {duration:300}) }) .mouseout(function(){ $(this).stop().animate({backgroundPosition:\"(3px -35px)\"}, {duration:100, complete:function(){ $(this).css({backgroundPosition: \"3px -35px\"}) }}) }) }); $(document).ready(function(){ $(\".rounded-img, .rounded-img2\").load(function() { $(this).wrap(function(){ return \'\'; }); $(this).css(\"opacity\",\"0\"); }); }); $(document).ready(function() { $(\'.fade\').dwFadingLinks({ color: \'#FF33CC\', duration: 299 }); });
function blinkIt() { if (!document.all) return; else { for(i=0;i |
||||||||
جمعه 21 آذر 1393 - 22:22 |
|
raveh123
![]() ![]() ![]()
|
پاسخAnswer 1 : محدوده حرکت این اسکریپ رو برام درست کنید بد شد بزارین باز بفرستم کد: // JavaScript Document |
||||||||
جمعه 21 آذر 1393 - 22:22 |
|
smaeal
![]() ![]() ![]()
|
پاسخAnswer 2 : محدوده حرکت این اسکریپ رو برام درست کنید کد چیه...؟؟؟ من باید بدونم کجاش رو ویرایش کنم.... |
||||||||
شنبه 22 آذر 1393 - 09:35 |
|
![]() |
سپاس هاThanks (1) : raveh123 - |
raveh123
![]() ![]() ![]()
|
پاسخAnswer 3 : محدوده حرکت این اسکریپ رو برام درست کنید این کدبرای هدر وبلاگم هست که این قسمتش زیادهست ونمی تونم کمش کنم روی مطالبم رو میگره الان برای تست گذاشتمش روی این آدرسahang789.loxblog.com |
||||||||
شنبه 22 آذر 1393 - 11:23 |
|
smaeal
![]() ![]() ![]()
|
پاسخAnswer 4 : محدوده حرکت این اسکریپ رو برام درست کنید نمیدونم دقیقاً کجاشو میگین...آخه برای من درست نمایش داده میشه!!!! یه عکس از مرورگر خودتون بزارید ببینم توی مرورگر شما چطوری نمایش داده میشه؟؟؟ |
||||||||
شنبه 22 آذر 1393 - 11:29 |
|
![]() |
سپاس هاThanks (1) : raveh123 - |
smaeal
![]() ![]() ![]()
|
پاسخAnswer 5 : محدوده حرکت این اسکریپ رو برام درست کنید ببین این خوبه و کار میکنه یا نه: کد: // JavaScript Document |
||||||||
شنبه 22 آذر 1393 - 11:34 |
|
![]() |
سپاس هاThanks (1) : raveh123 - |
raveh123
![]() ![]() ![]()
|
پاسخAnswer 6 : محدوده حرکت این اسکریپ رو برام درست کنید نه متاسفانه میخواید کدقالبو بهتون بدم تا بهتر ببینید |
||||||||
شنبه 22 آذر 1393 - 11:39 |
|
smaeal
![]() ![]() ![]()
|
پاسخAnswer 7 : محدوده حرکت این اسکریپ رو برام درست کنید اینو بزارید: کد: // JavaScript Document |
||||||||
شنبه 22 آذر 1393 - 11:40 |
|
![]() |
سپاس هاThanks (1) : raveh123 - |
smaeal
![]() ![]() ![]()
|
پاسخAnswer 8 : محدوده حرکت این اسکریپ رو برام درست کنید من هرکاری تونستم انجام دادم...فعلاً دارم میرم..بعد از ظهر بازم میام و بررسی میکنم...فعلاً از کد قبلی استفاده کنید و ببینید کار میکنه یا نه... |
||||||||
شنبه 22 آذر 1393 - 11:47 |
|
raveh123
![]() ![]() ![]()
|
پاسخAnswer 9 : محدوده حرکت این اسکریپ رو برام درست کنید باشه کد وبلاگمو برات فرستادم یه بررسی بکن بی زحمت |
||||||||
شنبه 22 آذر 1393 - 11:49 |
|
smaeal
![]() ![]() ![]()
|
پاسخAnswer 10 : محدوده حرکت این اسکریپ رو برام درست کنید عزیز دل قالب رو اونطوری نمیفرستن... باید توی یه فایل بریزی و آپلود کنی و آدرسشو بدی به من... |
||||||||
شنبه 22 آذر 1393 - 12:53 |
|
![]() |
سپاس هاThanks (1) : raveh123 - |