~ubuntu-accomplishments-web-editor-drivers/ubuntu-accomplishments-web/trunk

« back to all changes in this revision

Viewing changes to ubuntu_website/media/js/main.js

  • Committer: Janos Gyerik
  • Date: 2012-12-14 23:20:41 UTC
  • mfrom: (233.1.14 cleaning)
  • Revision ID: janos@axiom-20121214232041-dutstr2s05outaps
ubuntu_website renamed to ubuntu_theme and cleaned up

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
$ = jQuery;         
2
 
for(n in docready) $(document).ready(docready[n]);
3
 
 
4
 
$(document).ready(function() {
5
 
  var $header = $('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>HEADER</h3></div>'),
6
 
      $aside = $('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>ASIDE</h3></div>'),
7
 
      $content = $('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>CONTENT</h3></div>'),
8
 
      $footer = $('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>FOOTER</h3></div>');
9
 
 
10
 
  $("#wireframe .container").mouseenter(function() {
11
 
    var ele = $(this);
12
 
    ele.css({border:"1px dashed #555", padding:"0px 9px"});
13
 
    if(ele.parent().is("header")) {
14
 
      ele.append($header)
15
 
    }
16
 
    if(ele.parent().is("aside")) {
17
 
      ele.append($aside)
18
 
    }
19
 
    if(ele.parent().is("section")) {
20
 
      ele.append($content)
21
 
    }
22
 
    if(ele.parent().is("footer")) {
23
 
      ele.append($footer)
24
 
    }
25
 
  });
26
 
 
27
 
  $("#wireframe .container").mouseleave(function() {
28
 
    $(".label").remove();
29
 
    $(this).css({border:"0px dashed #555", padding:"0px 10px"})
30
 
  })
31
 
});
32
 
 
33
 
var trypie = function(){
34
 
  if(window.PIE){
35
 
    $('*').each(function(){
36
 
      if($(this).css('box-shadow') || $(this).css('border-radius')){
37
 
          PIE.attach(this);
38
 
      }
39
 
    });
40
 
  }
41
 
}
 
 
b'\\ No newline at end of file'