banniere defilante [Réglé]
comment faire pour mettre une banniere defilante
Créations de Thèmes
ptiloup33 Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre ptiloup33
- Inscrit le : 29/01/2012
- Site internet
- Groupes :
voici le code :
Code :
<style type="text/css">
/*Example CSS for the two demo scrollers*/
#pscroller1{
font-size: 12px;
font-family: verdana;
width: 180px;
height: 100px;
border: 1px solid black;
padding: 5px;
background-color: cyan;
#pscroller2 a{
text-decoration: none;
}
.someclass{ //class to apply to your scroller(s) if desired
}
</style>
<script type="text/javascript">
/*Example message arrays for the two demo scrollers*/
var pausecontent=new Array()
pausecontent[0]='[url=http://www.cuma-alliance-guipry.com/accueil.html?origin=pub15190]Cuma-alliance-guipry[/url]
Merveilleux site sur la machinerie agricole'
pausecontent[1]='[url=http://ticoune.e-monsite.com]Chez Ti-Coune[/url]
Un tres beau site humour,diaporama,histoires,<br>blagues,quizz,puzzle'
pausecontent[2]='[url=http://www.google.ca/DESIGN/Google]Google[/url]
Moteur de recherche sur le web '
pausecontent[3]='[url=http://cheznadia.e-monsite.com/accueil.html?origin=pub15190]Chez Nadia[/url]
Merveilleux site à voir sans faute,il vaut le détour'
pausecontent[4]='[url=http://pause-cafe.e-monsite.com]pause-cafe[/url]
le site de votre humble serviteur,merci de votre visite'
pausecontent[5]='[url=http://petitcolibri.e-monsite.com/]Chez Petit Colibri[/url]
Un autre merveilleux site qui vaut le détour '
pausecontent[6]='[url=http://www.grandmamanjacqueline.com/?origin=pub15190]Grand-maman Jacqueline[/url]
Voici la grand-maman de tous les webmasters,allez lui dire bonjour'
pausecontent[7]='[url=http://www.rire-et-detente.com/]Chez Rire et Detente[/url]
Un tres beau site pour le rire et la detente'
pausecontent[8]='[url=http://www.la-planete-des-abeilles.com/]leschtitesabeilles[/url]
La planète des abeilles,un autre site incontournable '
pausecontent[9]='[url=http://spherebleue.e-monsite.com/?origin=pub15190]spherebleue[/url]
Merveilleux site sur l architecture,dite-lui bonjour de ma part'
</script>
<script type="text/javascript">
/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
***********************************************/
function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}
// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------
pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}
// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------
pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}
// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------
pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}
pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}
// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------
pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}
pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}
</script>
<script type="text/javascript">
//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)
new pausescroller(pausecontent, "pscroller1", "someclass", 3000)
document.write("
")
new pausescroller(pausecontent2, "pscroller2", "someclass", 2000)
</script>
<font face="verdana" size="1">Édité par janus57 Le 10/07/2017 à 12h26
benflovideo Membre non connecté
-
Modérateur
- Voir le profil du membre benflovideo
- Inscrit le : 13/03/2010
- Groupes :
-
Equipe Modération
-
Equipe Communication
Aie les yeux... Il faut utiliser la balise code lorsque tu colles du code dans ton message :
Benji
olivierb Membre non connecté
-
Modérateur
- Voir le profil du membre olivierb
- Inscrit le : 07/02/2014
- Site internet
- Groupes :
-
Equipe Assistance
Pourquoi n'attends-tu pas la réponse de Swan sur son forum ?
Il me semble d'ailleurs qu'elle avait déjà donné la solution dans un autre post (ici ou sur EDN).
Olivier.
Édité par olivierb Le 10/07/2017 à 11h13
Olivier


Swan Membre non connecté
Booster Mortier
-
Booster Mortier
- Voir le profil du membre Swan
- Inscrit le : 31/05/2013
- Site internet
Je viens de lui répondre sur EDN, mais je vais aussi donner la réponse ici :
<div class="formatter-container formatter-blockquote"><span class="formatter-title">Citation :</span><div class="formatter-content">Bonjour,
Je suis partie sur cette base : <a href="https://codepen.io/jamesbarnett/pen/kfmKa">https://codepen.io/jamesbarnett/pen/kfmKa</a> <img src="/images/smileys/happy.png" alt="^^" class="smiley" />
Swan.</div></div>
<img src="/images/smileys/wink.png" alt=";)" class="smiley" />

ptiloup33 Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre ptiloup33
- Inscrit le : 29/01/2012
- Site internet
- Groupes :
ptiloup33 Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre ptiloup33
- Inscrit le : 29/01/2012
- Site internet
- Groupes :
Code BBCODE :
<style type="text/css">
/*Example CSS for the two demo scrollers*/
#pscroller1{
font-size: 12px;
font-family: verdana;
width: 180px;
height: 100px;
border: 1px solid black;
padding: 5px;
background-color: cyan;
#pscroller2 a{
text-decoration: none;
}
.someclass{ //class to apply to your scroller(s) if desired
}
</style>
<script type="text/javascript">
/*Example message arrays for the two demo scrollers*/
var pausecontent=new Array()
pausecontent[0]='<a href="http://www.cuma-alliance-guipry.com/accueil.html?origin=pub15190" target="_blank">Cuma-alliance-guipry</a><br />Merveilleux site sur la machinerie agricole'
pausecontent[1]='<a href="http://ticoune.e-monsite.com" target="_blank">Chez Ti-Coune</a><br />Un tres beau site humour,diaporama,histoires,<br>blagues,quizz,puzzle'
pausecontent[2]='<a href="http://www.google.ca/DESIGN/Google">Google</a><br />Moteur de recherche sur le web '
pausecontent[3]='<a href="http://cheznadia.e-monsite.com/accueil.html?origin=pub15190" target="_blank">Chez Nadia</a><br />Merveilleux site à voir sans faute,il vaut le détour'
pausecontent[4]='<a href="http://pause-cafe.e-monsite.com" target="_blank">pause-cafe</a><br />le site de votre humble serviteur,merci de votre visite'
pausecontent[5]='<a href="http://petitcolibri.e-monsite.com/">Chez Petit Colibri</a><br />Un autre merveilleux site qui vaut le détour '
pausecontent[6]='<a href="http://www.grandmamanjacqueline.com/?origin=pub15190" target="_blank">Grand-maman Jacqueline</a><br />Voici la grand-maman de tous les webmasters,allez lui dire bonjour'
pausecontent[7]='<a href="http://www.rire-et-detente.com/" target="_blank">Chez Rire et Detente</a><br />Un tres beau site pour le rire et la detente'
pausecontent[8]='<a href="http://www.la-planete-des-abeilles.com/">leschtitesabeilles</a><br />La planète des abeilles,un autre site incontournable '
pausecontent[9]='<a href="http://spherebleue.e-monsite.com/?origin=pub15190" target="_blank">spherebleue</a><br />Merveilleux site sur l architecture,dite-lui bonjour de ma part'
</script>
<script type="text/javascript">
/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
***********************************************/
function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}
// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------
pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}
// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------
pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}
// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------
pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}
pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}
// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------
pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}
pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}
</script>
<script type="text/javascript">
//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)
new pausescroller(pausecontent, "pscroller1", "someclass", 3000)
document.write("<br />")
new pausescroller(pausecontent2, "pscroller2", "someclass", 2000)
</script>
<p><font face="verdana" size="1"></p> Swan Membre non connecté
Booster Mortier
-
Booster Mortier
- Voir le profil du membre Swan
- Inscrit le : 31/05/2013
- Site internet
C'est un gros morceau pour un néophyte en codage. Ce genre de code demande un peu de réflexion .. déjà séparer les données dans les fichiers appropriés.
1/ Le Js ne va pas en brut dans le body.tpl. On appelle le fichier "tartampion.JS" dans la balise <header>...</header>, que l'on aura préalablement créée avec les données JavaScript.
2/ placer les élément html dans le body.tpl.
3/ Faire attention de bien placer le déclencheur sous le div HTML :
Code TPL :
4/ Et pour finir , il faut vérifier le positionnement css.
Swan.
Édité par Swan Le 10/07/2017 à 14h29

ptiloup33 Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre ptiloup33
- Inscrit le : 29/01/2012
- Site internet
- Groupes :
ptiloup33 Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre ptiloup33
- Inscrit le : 29/01/2012
- Site internet
- Groupes :
je pense que je vais pas m'en sortir , pourtant j'aimerais arrive a rentrer ce bandeau défilant sur mon site
ptiloup33 Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre ptiloup33
- Inscrit le : 29/01/2012
- Site internet
- Groupes :
benflovideo Membre non connecté
-
Modérateur
- Voir le profil du membre benflovideo
- Inscrit le : 13/03/2010
- Groupes :
-
Equipe Modération
-
Equipe Communication
babsolune Membre non connecté
-
Administrateur
- Voir le profil du membre babsolune
- Inscrit le : 16/05/2008
- Site internet
- Groupes :
-
Equipe Développement

Tu es en quelle version de pbt ?
Édité par babsolune Le 12/07/2017 à 21h28
ptiloup33 Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre ptiloup33
- Inscrit le : 29/01/2012
- Site internet
- Groupes :
babsolune Membre non connecté
-
Administrateur
- Voir le profil du membre babsolune
- Inscrit le : 16/05/2008
- Site internet
- Groupes :
-
Equipe Développement
Citation :quand je le met il va se mettre tout en bas de la page et moi je le voudrait sous le header merci
1. en html5 il n'y a plus besoin de la partie
type="text/javascript", qui plus est, son interprétation par pbt peut causer des problèmes
2. comme l'a dit Swan
Citation :.. déjà séparer les données dans les fichiers appropriés.
ce qui est confirmé et détaillé sur le site de l'auteur Pausing up-down Scroller
Adapté à pbt, il faudra
- créer un dossier
js
dans ton thème - créer dans ce dossier
js
, le fichierpausingscroller.js
avec ce contenu - déclarer l'appel de ce fichier dans ton frame.tpl entre la déclaration du js de pbt
# INCLUDE JS_TOP #
et la balise fermante</html>
<script src="{PATH_TO_ROOT}/templates/{THEME}/js/pausingscroller.js"></script>
Idem pour le css
Édité par babsolune Le 13/07/2017 à 07h49
ptiloup33 Membre non connecté
Booster Bazooka
-
Booster Bazooka
- Voir le profil du membre ptiloup33
- Inscrit le : 29/01/2012
- Site internet
- Groupes :
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie
