Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function(){
  2.  
  3.     // Tableau for the theme , title , type
  4. var titre = ["Emploi", "Sante","Logement","Formation/Orientation","Droit Civils"];
  5. var theme = ["aqua","pinkrose","default","grass","lavander"];
  6. var ctype = ["Caqua","Cpinkrose" ,"Cdefault","Cgrass","lavander"];
  7. var num = 0 ;
  8. var categorie = 0 ;
  9. var allbuton = "" ;
  10.     //  Emploi
  11.     var titreE = ["Pole Emploi","Linkedin"];
  12.     var imgE = ["poleemploi.jpg","linkedin.jpg"];
  13.  
  14.    // loop to display the buttons
  15. for (var i = 0 ; i < 5 ; i++) {
  16.     var text = "<h2><span class="+ctype[num]+">"+titre[num]+"</span></h2>";
  17.     var buton = "<button class="+theme[num]+">"+text+"</button>";
  18.     allbuton = allbuton + buton ;
  19.     num ++ ;  
  20.     }
  21.  
  22.     // display the buttons
  23. $("#main").html(allbuton);
  24.  
  25.  
  26.     // fonction for the event for all buttons
  27. $(".aqua").click( function() {
  28.  
  29. categorie = 0 ;
  30.  window.location = 'C:/Users/Ucivique2/Desktop/Apli/html/categorie.html';
  31. });
  32. $(".pinkrose").click(function() {
  33. categorie = 1; 
  34.  window.location = 'C:/Users/Ucivique2/Desktop/Apli/html/categorie.html';
  35. });
  36. $(".default").click(function() {
  37. categorie = 2 ;
  38.  window.location = 'C:/Users/Ucivique2/Desktop/Apli/html/categorie.html';
  39. });
  40. $(".grass").click(function() {
  41. categorie = 3 ;
  42.  window.location = 'C:/Users/Ucivique2/Desktop/Apli/html/categorie.html';
  43. });
  44. $(".lavander").click(function() {
  45. categorie = 4 ;
  46.  window.location = 'C:/Users/Ucivique2/Desktop/Apli/html/categorie.html';
  47. });
  48.     num = categorie;
  49.     var allbuton = "";
  50.     for (var i = 0 ; i < 2 ; i++) {
  51.     var lienE = "C:/Users/Ucivique2/Desktop/Apli/images/"+imgE[num]
  52.     var text = "<h2><img class='img' src = "+lienE+"> <span class="+ctype[categorie]+">"+titreE[num]+"</span></h2>";
  53.     var classee = theme[categorie]+num;
  54.     var buton = "<button class="+classee+">"+text+"</button> ";
  55.     allbuton = allbuton + buton ;
  56.     num ++ ;
  57.     }  
  58.     $("#categorie").html(allbuton);
  59.  
  60. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement