Q:

آیفون آنلاین با تغییر صفحه در صفحات جداگانه .....

این یک اسکریپت جاوا هست که از یکی از سایت های خارجی گرفتم اما به شدت توش تغییر دادم وبکگراند آیفون گذاشتم تاشبیه اون بشه و هیچ ان کدی نکردم تا شما بتونید راحت تغییر بدین

دمو آیفون

کد:
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title>iOS Home Screen with CoffeeScript | Tutorialzine Demo</title> <!-- Our CSS stylesheet file --> <link rel="stylesheet" href="http://up.iapps98.tk/up/iapps/iphone/css/styles.css" /> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body>

<section id="homeScreen"> <div id="mask"> <div id="allScreens"></div> </div> <ul id="indicators"></ul> <div id="dock"></div> </section> <!-- JavaScript includes --> <script src="http://code.jquery.com/jquery-1.6.3.min.js"></script> <script src="http://up.iapps98.tk/up/iapps/iphone/js/touchable.js"></script> <script src="http://up.iapps98.tk/up/iapps/iphone/js/coffee-script.js"></script> <script type="text/coffeescript"> # The Icon class. class Icon

# The constructor. The -> arrow signifies # a function definition. constructor: (@id, @title, @url) -> # @ is synonymous for "this". The id and title parameters # of the construtor are automatically added as this.id and this.title # @markup holds the HTML of the icon. It is # transformed to this.markup behind the scenes. @markup = "<a href='#{@url}'><div class='icon' style='background-image:url(http://up.iapps98.tk/up/iapps/iphone/img/icons/#{@id}.png)' title='#{@title}'></div></a>"

# The DockIcon class inherits from Icon class DockIcon extends Icon constructor: (id, title, url)->

# This calls the constructor if Icon super(id, title, url) # Changing the class name of the generated HTML @markup = @markup.replace("class='icon'","class='dockicon'") # The Screen Class class Screen # Function arguments can have default parameters constructor: (icons = [])-> @icons = icons attachIcons: (icons = [])-> Array.prototype.push.apply(@icons, icons)

generate: -> markup = [] # Looping through the @icons array markup.push(icon.markup) for icon in @icons # The last line of every function is implicitly returned "<div class='screen'>#{markup.join('')}</div>"

class Stage # The width of our "device" screen. This is # basically the width of the #mask div. screenWidth: 332 constructor: (icons)-> @currentScreen = 0 @screens = [] # Calculating the number of screens # necessary to display all the icons num = Math.ceil(icons.length / 16) i = 0 while num-- # we pass a slice of the icons array s = new Screen(icons[i...i+16]) # adding the screen to the local screens array @screens.push(s) i+=16 # This method populates the passed element with HTML addScreensTo: (element)-> @element = $(element) @element.width(@screens.length*@screenWidth) for screen in @screens @element.append(screen.generate()) addIndicatorsTo: (elem)-> # This method creates the small # circular indicatiors @ul = $(elem) for screen in @screens @ul.append('<li>') @ul.find('li:first').addClass('active'); goTo: (screenNum)-> # This method animates the allScreen div in # order to expose the needed screen in #mask if @element.is(':animated') return false # if this is the first or last screen, # run the end of scroll animation if @currentScreen == screenNum # Parallel assignment: [from, to] = ['+=15','-=15'] if @currentScreen != 0 [from, to] = [to, from] @element.animate( { marginLeft : from }, 150 ) .animate( { marginLeft : to }, 150 ) else # If everything is ok, animate the transition between the screens. # The fat arrow => preserves the context of "this" @element.animate( { marginLeft:-screenNum*@screenWidth }, => @currentScreen = screenNum ) @ul.find('li').removeClass('active').eq(screenNum).addClass('active'); next: -> toShow = @currentScreen+1 # If there is no next screen, show # the current one if toShow == @screens.length toShow = @screens.length - 1 @goTo(toShow) previous: -> toShow = @currentScreen-1 # If there is no previous screen, # show the current one if toShow == -1 toShow = 0 @goTo(toShow) # This is equivalent to $('document').ready(function(){}): $ -> allIcons = [ new Icon('Photos', 'گالری عکس','#'),new Icon('Maps', 'نقشه','#') new Icon('Chuzzle', 'Chuzzle','#'), new Icon('Safari', 'مرورگر','#') new Icon('Weather', 'Weather','#'), new Icon('nes', 'NES Emulator','#') new Icon('Calendar', 'Calendar','#'), new Icon('Clock', 'Clock','#') new Icon('BossPrefs', 'Boss Prefs','#'), new Icon('Chess', 'شطرنج','#') new Icon('Mail', 'ایمیل','#'), new Icon('Phone', 'Phone','#') new Icon('SMS', 'SMS Center','#'), new Icon('Camera', 'Camera','#') new Icon('iPod', 'iPod','#'), new Icon('Calculator', 'Calculator','#') new Icon('Music', 'آهنگ','#'), new Icon('Poof', 'Poof','#') new Icon('Settings', 'Settings','#'), new Icon('YouTube', 'Youtube','#') new Icon('psx4all', 'PSx4All','#'), new Icon('VideoRecorder', 'Record Video','#') new Icon('Installer', 'Installer','#'), new Icon('Notes', 'Notes','#') new Icon('RagingThunder', 'RagingThunder','#'), new Icon('Stocks', 'Stocks','#') new Icon('genesis4iphone', 'Genesis','#'), new Icon('snes4iphone', 'SNES Emulator','#') new Icon('Calendar', 'Calendar','#'), new Icon('Clock', 'Clock','#') new Icon('Photos', 'Photo Gallery','#'), new Icon('Maps', 'Google Maps','#') ] dockIcons = [ new DockIcon('Camera', 'Camera','#') new DockIcon('iPod', 'iPod','#') new DockIcon('Calculator', 'Calculator','#') new DockIcon('Calculator', 'Calculator','#') ] allScreens = $('#allScreens') # Using the Touchable plugin to listen for # touch based events: allScreens.Touchable();

# Creating a new stage object stage = new Stage(allIcons) stage.addScreensTo(allScreens) stage.addIndicatorsTo('#indicators') # Listening for the touchablemove event. # Notice the callback function allScreens.bind 'touchablemove', (e,touch)-> stage.next() if touch.currentDelta.x < -5 stage.previous() if touch.currentDelta.x > 5 # Adding the dock icons: dock = $('#dock') for icon in dockIcons dock.append(icon.markup) </script>

</body></html>

کدهای جاوا اسکریپت
پاسخ ها

خیلی باهاله...

ممنون

يه جوري مي گي انگار خودت ساختيش

اينا كار اون خارجي هاي خرمغزند

ممون داداشی خیلی عالی هست. لطفا منبع و کد نویسش را بزار

بسیار گود

دمت جیززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززززز

دوستان منبعش این سایته http://tutorialzine.com/

تازه سازي پاسخ ها
پست های مرتبط

کد HTML رنگ ها

  • hamlo
  • شنبه 29 تیر 1398 - 12:03

درخواست کد تعقیر زبان سایت

چگونگی حذف چیزی در صفحه با استفاده از جی کوئری

  • mostafa
  • یکشنبه 23 تیر 1398 - 2:37

کد شیک و ساده گوگل پلاس

  • mostafa
  • جمعه 07 تیر 1398 - 3:06

کد ساعت دیجیتال فوق جالب

  • pooya-hir
  • چهارشنبه 03 مرداد 1397 - 17:37

کد کاربردی افراد انلاین

  • six-6
  • سه شنبه 26 تیر 1397 - 12:24

ابزاری جدید و کمیاب برای دوستداران رزبلاگ

  • smaeal
  • چهارشنبه 23 اسفند 1396 - 17:02

سورس های کاربردی جاوا اسکریپت

  • amireza
  • چهارشنبه 23 اسفند 1396 - 17:02

ابزار ساخت کد باز بسته کردن بلاک

  • mostafa
  • چهارشنبه 23 اسفند 1396 - 17:00

کد تازه سازی خوکار برای انجمن های رزبلاگ

  • tanhatarin
  • چهارشنبه 23 اسفند 1396 - 16:58

ابزار باز شدن وبسایت با قالب انتخابی کاربر

  • ahm
  • چهارشنبه 23 اسفند 1396 - 16:56

ابزار تغییر رنگ بکگراند قالب وبلاگ و سایت

  • mostafa
  • چهارشنبه 23 اسفند 1396 - 16:56

کد چت روم برای رز بلاگ (رایگان و جدید)

  • amireza
  • چهارشنبه 23 اسفند 1396 - 16:55

اسکریپت خبر خوان با قابلیت استایل پذیری بدون تبلیغات

  • hossein16
  • چهارشنبه 23 اسفند 1396 - 16:53

کد پخش فیلم و موسیقی در انجمن به همراه کد

  • smaeal
  • چهارشنبه 23 اسفند 1396 - 16:52

کسی که PHP بلده لطفا کنه بیاد ممنون (((تشکر)))

  • qahr
  • چهارشنبه 23 اسفند 1396 - 16:51

کدفال روزانه آوای نرماشیر

بستن کنترل u سایت

  • saeedlashh
  • چهارشنبه 23 اسفند 1396 - 16:50

كد انتقال دامينهاي رزبلاگ به دامنه شخصي

مشکل در گذاشتن کدهای جاوا اسکریپ

  • mamad037
  • چهارشنبه 23 اسفند 1396 - 16:48
ارسال تیکت