Permalink
Browse files

Fade in new frame on top of old then remove old

  • Loading branch information...
1 parent 7e3c001 commit b30e11900778f7f63c41d9b4d09b330494162a38 @devth committed May 4, 2011
View
@@ -1,4 +1,7 @@
-body { margin: 0; padding: 0; overflow: hidden; }
+html, body { margin: 0; padding: 0; overflow: hidden; height: 100%; }
-#content .split { float: left; width: 50%; overflow: hidden; }
-iframe { width: 100%; height: 100%; border: 0px solid white; overflow: auto }
+#content .split { float: left; width: 50%; height: 100%; position: relative; }
+#content .iframe_container { position: absolute; width: 100%; height: 100%; top: 0; }
+iframe { width: 100%; height: 100%; border: 0px solid white; overflow: hidden; }
+
+.clear { clear: both; }
View
@@ -17,8 +17,10 @@
</script>
<div id="content">
<div class="left split">
+ &nbsp;
</div>
<div class="right split">
+ &nbsp;
</div>
</div>
</body>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -6,5 +6,4 @@ class ApplicationController extends Backbone.Controller
"*urls": "handleRoute"
handleRoute: (hash) ->
urls = hash.split(",").map (url) -> { url: url }
- console.log("route", urls)
@urls.refresh(urls)
@@ -14,7 +14,7 @@ class ApplicationView extends Backbone.View
if @model.size() > 2
# cycle - starting on the 2nd url
@currentUrlIndex = 2
- @cycleInterval = setInterval (=> @showNext()), 10000
+ @cycleInterval = setInterval (=> @showNext()), 8000
# init with the first 2 urls
if @model.size() > 1
@@ -2,9 +2,10 @@ class Frame extends Backbone.View
initialize: ->
@template = $("#frame").html()
render: ->
- $html = $(_.template(@template, @model.attributes)).css("visibility", "none")
- @el.html($html)
- setTimeout (-> $html.fadeIn()), 200
+ $html = $(_.template(@template, @model.attributes)).hide()
+ $existingFrames = @$(".iframe_container")
+ @el.append($html)
+ setTimeout (=> $html.fadeIn('slow', => $existingFrames.remove(); console.log($existingFrames) )), 1000
setModel: (model) ->
@model = model
@render()

0 comments on commit b30e119

Please sign in to comment.