http://m.getsatisfaction.com/tags/1208681/topics?page=1 Topics tagged with _headermodulelist.tpl 1970-01-01T00:00:00Z 4 4 0 0 0 0 http://m.getsatisfaction.com/topics/5912085 5912085 Javascript running everytime i change a page... 2014-01-13T19:15:54Z 2014-01-13T19:15:50Z FAQ http://m.getsatisfaction.com/people/6481102 https://d2r1vs3d9006ap.cloudfront.net/public/uploaded_images/10257158/FAQAvatar_medium.png faq_6176540 Hi everyone...<br /><br /> I changed my _headerModuleList.tpl in way to have a header displaying time:<br /><br /> [ATTACH]10624[/ATTACH]<br /><br /> The problem is that sometimes (when i change page, but not always) it doesnt run the javascript i added and the time doesn't appear...<br /><br /> my code on _headerModuleList.tpl<br /><br /> [CODE]{php} <br /><br /> global $current_user; <br /><br /> $id = $current_user->id;<br /><br /> $imp_id = $current_user->trabalho_imp_c;<br /><br /> if ($imp_id != '' && $imp_id != NULL) {<br /><br /> require_once('modules/CONT_Imputacao_Tempos/CONT_Imputacao_Tempos.php');<br /><br /> $imp = new CONT_Imputacao_Tempos();<br /><br /> $imp->retrieve($imp_id);<br /><br /> {/php} <br /><br /> A trabalhar em: {php}echo $imp->accounts_cont_imputacao_tempos_1_name;{/php}<br /><br /> ênicio: {php}echo $imp->inicio;{/php}<br /><br /> Tempo: <br /><br /> Finalizar Interven‹o<br /><br /> {php} <br /><br /> }<br /><br /> {/php} [/CODE]<br /><br /> my javascript code:<br /><br /> [CODE]<br /><br /> //Function that calculates the time and stick the header to the top of the page when you scroll down<br /><br /> function timer() {<br /><br /> // This function will be executed when the user scrolls the page.<br /><br /> $(window).scroll(function(e) {<br /><br /> // Get the position of the location where the scroller starts.<br /><br /> var scroller_anchor = $('.scroller_anchor').offset().top;<br /><br /> // Check if the user has scrolled and the current position is after the scroller start location and if its not already fixed at the top<br /><br /> if ($(this).scrollTop() >= scroller_anchor && $('.scroller').css('position') != 'fixed')<br /><br /> { // Change the CSS of the scroller to hilight it and fix it at the top of the screen.<br /><br /> $('.scroller').css({<br /><br /> 'background': '#C50000',<br /><br /> 'border': '1px solid #000',<br /><br /> 'position': 'fixed',<br /><br /> 'top': '0px',<br /><br /> 'width':'100%',<br /><br /> 'height': '20px',<br /><br /> });<br /><br /> // Changing the height of the scroller anchor to that of scroller so that there is no change in the overall height of the page.<br /><br /> $('.scroller_anchor').css('height', '50px');<br /><br /> }<br /><br /> else if ($(this).scrollTop() 60) {<br /><br /> aux = Math.floor(t/60);<br /><br /> remaining = t % 60;<br /><br /> t = aux + 'h '+remaining;<br /><br /> }<br /><br /> t +='m';<br /><br /> return t;<br /><br /> }<br /><br /> if (window.addEventListener) //DOM method for binding an event<br /><br /> window.addEventListener('load', timer, false);<br /><br /> else if (window.attachEvent) //IE exclusive method for binding an event<br /><br /> window.attachEvent('onload', timer);<br /><br /> else if (document.getElementById) //support older modern browsers<br /><br /> window.onload=timer;<br /><br /> [/CODE]<br /><br /> like i said it doesnt run the 'custom/themes/default/javascript/java.js' (sorry for the confusion on the code)<br /><br /> Can anyone help me?<br /><br /> Thank you in advanced,<br /><br /> Spock :cool:<br /><br /> (from SpockPT) question 3 1 1 create scroller, var, change, position, page, top, time, back, height, $imp_id, code, scroller_anchor, anchor, timer, fixed, javascript, location, user, function, css, run, method, 0px, _headermodulelist.tpl, solid, border, aux, c50000, background, 1px, binding, remaining, header, phpecho, hours, scrolled, content, php, start, relative, event, $.scroller_anchor.cssheight, $.scroller.cssposition, $.scroller.css, $this.scrolltop, minutes, startcalculatedminutes, checklengthtime[1], dateandtime http://m.getsatisfaction.com/topics/5907061 5907061 Javascript running everytime i change a page... 2014-01-10T22:08:42Z 2014-01-10T22:08:38Z Emma at Get Satisfaction http://m.getsatisfaction.com/people/6561145 https://d2r1vs3d9006ap.cloudfront.net/public/uploaded_images/10239366/jar-gon_medium.png emma_at_get_satisfaction Hi everyone...<br /><br /> I changed my _headerModuleList.tpl in way to have a header displaying time:<br /><br /> [ATTACH]10624[/ATTACH]<br /><br /> The problem is that sometimes (when i change page, but not always) it doesnt run the javascript i added and the time doesn't appear...<br /><br /> my code on _headerModuleList.tpl<br /><br /> [CODE]{php} <br /><br /> global $current_user; <br /><br /> $id = $current_user->id;<br /><br /> $imp_id = $current_user->trabalho_imp_c;<br /><br /> if ($imp_id != '' && $imp_id != NULL) {<br /><br /> require_once('modules/CONT_Imputacao_Tempos/CONT_Imputacao_Tempos.php');<br /><br /> $imp = new CONT_Imputacao_Tempos();<br /><br /> $imp->retrieve($imp_id);<br /><br /> {/php} <br /><br /> A trabalhar em: {php}echo $imp->accounts_cont_imputacao_tempos_1_name;{/php}<br /><br /> ênicio: {php}echo $imp->inicio;{/php}<br /><br /> Tempo: <br /><br /> Finalizar Interven‹o<br /><br /> {php} <br /><br /> }<br /><br /> {/php} [/CODE]<br /><br /> my javascript code:<br /><br /> [CODE]<br /><br /> //Function that calculates the time and stick the header to the top of the page when you scroll down<br /><br /> function timer() {<br /><br /> // This function will be executed when the user scrolls the page.<br /><br /> $(window).scroll(function(e) {<br /><br /> // Get the position of the location where the scroller starts.<br /><br /> var scroller_anchor = $('.scroller_anchor').offset().top;<br /><br /> // Check if the user has scrolled and the current position is after the scroller start location and if its not already fixed at the top<br /><br /> if ($(this).scrollTop() >= scroller_anchor && $('.scroller').css('position') != 'fixed')<br /><br /> { // Change the CSS of the scroller to hilight it and fix it at the top of the screen.<br /><br /> $('.scroller').css({<br /><br /> 'background': '#C50000',<br /><br /> 'border': '1px solid #000',<br /><br /> 'position': 'fixed',<br /><br /> 'top': '0px',<br /><br /> 'width':'100%',<br /><br /> 'height': '20px',<br /><br /> });<br /><br /> // Changing the height of the scroller anchor to that of scroller so that there is no change in the overall height of the page.<br /><br /> $('.scroller_anchor').css('height', '50px');<br /><br /> }<br /><br /> else if ($(this).scrollTop() 60) {<br /><br /> aux = Math.floor(t/60);<br /><br /> remaining = t % 60;<br /><br /> t = aux + 'h '+remaining;<br /><br /> }<br /><br /> t +='m';<br /><br /> return t;<br /><br /> }<br /><br /> if (window.addEventListener) //DOM method for binding an event<br /><br /> window.addEventListener('load', timer, false);<br /><br /> else if (window.attachEvent) //IE exclusive method for binding an event<br /><br /> window.attachEvent('onload', timer);<br /><br /> else if (document.getElementById) //support older modern browsers<br /><br /> window.onload=timer;<br /><br /> [/CODE]<br /><br /> like i said it doesnt run the 'custom/themes/default/javascript/java.js' (sorry for the confusion on the code)<br /><br /> Can anyone help me?<br /><br /> Thank you in advanced,<br /><br /> Spock :cool:<br /><br /> (from SpockPT) question 3 1 1 create scroller, var, change, position, page, top, time, back, height, $imp_id, code, scroller_anchor, anchor, timer, fixed, javascript, location, user, function, css, run, method, 0px, _headermodulelist.tpl, solid, border, aux, c50000, background, 1px, binding, remaining, header, phpecho, hours, scrolled, content, php, start, relative, event, $.scroller_anchor.cssheight, $.scroller.cssposition, $.scroller.css, $this.scrolltop, minutes, startcalculatedminutes, checklengthtime[1], dateandtime http://m.getsatisfaction.com/topics/5902548 5902548 Javascript running everytime i change a page... 2014-01-08T23:56:25Z 2014-01-08T23:56:21Z Emma at Get Satisfaction http://m.getsatisfaction.com/people/6561145 https://d2r1vs3d9006ap.cloudfront.net/public/uploaded_images/10239366/jar-gon_medium.png emma_at_get_satisfaction Hi everyone...<br /><br /> I changed my _headerModuleList.tpl in way to have a header displaying time:<br /><br /> [ATTACH]10624[/ATTACH]<br /><br /> The problem is that sometimes (when i change page, but not always) it doesnt run the javascript i added and the time doesn't appear...<br /><br /> my code on _headerModuleList.tpl<br /><br /> [CODE]{php} <br /><br /> global $current_user; <br /><br /> $id = $current_user->id;<br /><br /> $imp_id = $current_user->trabalho_imp_c;<br /><br /> if ($imp_id != '' && $imp_id != NULL) {<br /><br /> require_once('modules/CONT_Imputacao_Tempos/CONT_Imputacao_Tempos.php');<br /><br /> $imp = new CONT_Imputacao_Tempos();<br /><br /> $imp->retrieve($imp_id);<br /><br /> {/php} <br /><br /> A trabalhar em: {php}echo $imp->accounts_cont_imputacao_tempos_1_name;{/php}<br /><br /> ênicio: {php}echo $imp->inicio;{/php}<br /><br /> Tempo: <br /><br /> Finalizar Intervenç‹o<br /><br /> {php} <br /><br /> }<br /><br /> {/php} [/CODE]<br /><br /> my javascript code:<br /><br /> [CODE]<br /><br /> //Function that calculates the time and stick the header to the top of the page when you scroll down<br /><br /> function timer() {<br /><br /> // This function will be executed when the user scrolls the page.<br /><br /> $(window).scroll(function(e) {<br /><br /> // Get the position of the location where the scroller starts.<br /><br /> var scroller_anchor = $('.scroller_anchor').offset().top;<br /><br /> // Check if the user has scrolled and the current position is after the scroller start location and if its not already fixed at the top<br /><br /> if ($(this).scrollTop() >= scroller_anchor && $('.scroller').css('position') != 'fixed')<br /><br /> { // Change the CSS of the scroller to hilight it and fix it at the top of the screen.<br /><br /> $('.scroller').css({<br /><br /> 'background': '#C50000',<br /><br /> 'border': '1px solid #000',<br /><br /> 'position': 'fixed',<br /><br /> 'top': '0px',<br /><br /> 'width':'100%',<br /><br /> 'height': '20px',<br /><br /> });<br /><br /> // Changing the height of the scroller anchor to that of scroller so that there is no change in the overall height of the page.<br /><br /> $('.scroller_anchor').css('height', '50px');<br /><br /> }<br /><br /> else if ($(this).scrollTop() 60) {<br /><br /> aux = Math.floor(t/60);<br /><br /> remaining = t % 60;<br /><br /> t = aux + 'h '+remaining;<br /><br /> }<br /><br /> t +='m';<br /><br /> return t;<br /><br /> }<br /><br /> if (window.addEventListener) //DOM method for binding an event<br /><br /> window.addEventListener('load', timer, false);<br /><br /> else if (window.attachEvent) //IE exclusive method for binding an event<br /><br /> window.attachEvent('onload', timer);<br /><br /> else if (document.getElementById) //support older modern browsers<br /><br /> window.onload=timer;<br /><br /> [/CODE]<br /><br /> like i said it doesnt run the 'custom/themes/default/javascript/java.js' (sorry for the confusion on the code)<br /><br /> Can anyone help me?<br /><br /> Thank you in advanced,<br /><br /> Spock :cool:<br /><br /> (from SpockPT) question 3 1 1 scroller, var, change, position, page, top, time, back, height, $imp_id, code, scroller_anchor, anchor, timer, fixed, javascript, location, user, function, css, run, method, 0px, _headermodulelist.tpl, solid, border, aux, c50000, background, 1px, binding, remaining, header, phpecho, hours, scrolled, content, php, start, relative, event, $.scroller_anchor.cssheight, $.scroller.cssposition, $.scroller.css, $this.scrolltop, minutes, startcalculatedminutes, checklengthtime[1], dateandtime http://m.getsatisfaction.com/topics/5902219 5902219 Javascript running everytime i change a page... 2014-01-08T22:49:32Z 2014-01-08T22:49:29Z Emma Test http://m.getsatisfaction.com/people/6395044 https://www.gravatar.com/avatar/e590fd483f3d42d9dffc1c1e99c55f4e?d=identicon&s=55&r=PG emma_test Hi everyone...<br /><br /> I changed my _headerModuleList.tpl in way to have a header displaying time:<br /><br /> [ATTACH]10624[/ATTACH]<br /><br /> The problem is that sometimes (when i change page, but not always) it doesnt run the javascript i added and the time doesn't appear...<br /><br /> my code on _headerModuleList.tpl<br /><br /> [CODE]{php} <br /><br /> global $current_user; <br /><br /> $id = $current_user->id;<br /><br /> $imp_id = $current_user->trabalho_imp_c;<br /><br /> if ($imp_id != '' && $imp_id != NULL) {<br /><br /> require_once('modules/CONT_Imputacao_Tempos/CONT_Imputacao_Tempos.php');<br /><br /> $imp = new CONT_Imputacao_Tempos();<br /><br /> $imp->retrieve($imp_id);<br /><br /> {/php} <br /><br /> A trabalhar em: {php}echo $imp->accounts_cont_imputacao_tempos_1_name;{/php}<br /><br /> ênicio: {php}echo $imp->inicio;{/php}<br /><br /> Tempo: <br /><br /> Finalizar Intervenç‹o<br /><br /> {php} <br /><br /> }<br /><br /> {/php} [/CODE]<br /><br /> my javascript code:<br /><br /> [CODE]<br /><br /> //Function that calculates the time and stick the header to the top of the page when you scroll down<br /><br /> function timer() {<br /><br /> // This function will be executed when the user scrolls the page.<br /><br /> $(window).scroll(function(e) {<br /><br /> // Get the position of the location where the scroller starts.<br /><br /> var scroller_anchor = $('.scroller_anchor').offset().top;<br /><br /> // Check if the user has scrolled and the current position is after the scroller start location and if its not already fixed at the top<br /><br /> if ($(this).scrollTop() >= scroller_anchor && $('.scroller').css('position') != 'fixed')<br /><br /> { // Change the CSS of the scroller to hilight it and fix it at the top of the screen.<br /><br /> $('.scroller').css({<br /><br /> 'background': '#C50000',<br /><br /> 'border': '1px solid #000',<br /><br /> 'position': 'fixed',<br /><br /> 'top': '0px',<br /><br /> 'width':'100%',<br /><br /> 'height': '20px',<br /><br /> });<br /><br /> // Changing the height of the scroller anchor to that of scroller so that there is no change in the overall height of the page.<br /><br /> $('.scroller_anchor').css('height', '50px');<br /><br /> }<br /><br /> else if ($(this).scrollTop() 60) {<br /><br /> aux = Math.floor(t/60);<br /><br /> remaining = t % 60;<br /><br /> t = aux + 'h '+remaining;<br /><br /> }<br /><br /> t +='m';<br /><br /> return t;<br /><br /> }<br /><br /> if (window.addEventListener) //DOM method for binding an event<br /><br /> window.addEventListener('load', timer, false);<br /><br /> else if (window.attachEvent) //IE exclusive method for binding an event<br /><br /> window.attachEvent('onload', timer);<br /><br /> else if (document.getElementById) //support older modern browsers<br /><br /> window.onload=timer;<br /><br /> [/CODE]<br /><br /> like i said it doesnt run the 'custom/themes/default/javascript/java.js' (sorry for the confusion on the code)<br /><br /> Can anyone help me?<br /><br /> Thank you in advanced,<br /><br /> Spock :cool:<br /><br /> (from SpockPT) question 3 1 1 create scroller, var, change, position, page, top, time, back, height, $imp_id, code, scroller_anchor, anchor, timer, fixed, javascript, location, user, function, css, run, method, 0px, _headermodulelist.tpl, solid, border, aux, c50000, background, 1px, binding, remaining, header, phpecho, hours, scrolled, content, php, start, relative, event, $.scroller_anchor.cssheight, $.scroller.cssposition, $.scroller.css, $this.scrolltop, minutes, startcalculatedminutes, checklengthtime[1], dateandtime