Recent Tutorials
Who is online?
In total there are 6 users online :: 2 Registered, 0 Hidden and 4 Guests

djblah, SLGray

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

Code Christmas lights stopped working.

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Sat 28 May 2016, 14:38

First topic message reminder :

@Ange Tuteur Code Christmas lights that you make stopped working. Can you fix it?

Code:
$(function(){$(function(){
  var padTop = true,
  frame = document.createElement('IFRAME'), body = document.body, s = '';
  frame.setAttribute('style','position:absolute;left:0;right:0;top:0;width:100%;height:100px;border:none;z-index:1000;');
  frame.src = 'http://opensource.olympe.in/lights/?size=tiny';
  frame.id = 'schillmania-lights';
  body.insertBefore(frame, body.firstChild);
 
  if (document.getElementById('fa_toolbar')) {
    frame.style.top = '28px';
    document.getElementById('fa_hide').onclick = function() { frame.style.top = '0px' };
    document.getElementById('fa_show').onclick = function() { frame.style.top = '28px' }
  }
  if (padTop == true) {
    if (body.getAttribute('style')) s = body.getAttribute('style');
    body.setAttribute('style',s + 'padding-top:100px !important;');
  }
})});

avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Wed 26 Oct 2016, 15:26

I deleted a row from appearing 2 button and be fine.

I would like button? with which to update the lamps.


I use this js code. Must be of js code can be set to move the lights to the right?
Code:
$(function(){$(function(){
  var padTop = true,
  frame = document.createElement('IFRAME'), body = document.body, s = '';
  frame.setAttribute('style','position:absolute;left:0;right:0;top:0;width:100%;height:80px;border:none;z-index:1000;');
  frame.src = 'http://hl-club.net16.net/lights/?size=tiny';
  frame.id = 'schillmania-lights';
  body.insertBefore(frame, body.firstChild);
 
  if (document.getElementById('fa_toolbar')) {
    frame.style.top = '28px';
    document.getElementById('fa_hide').onclick = function() { frame.style.top = '0px' };
    document.getElementById('fa_show').onclick = function() { frame.style.top = '28px' }
  }
  if (padTop == true) {
    if (body.getAttribute('style')) s = body.getAttribute('style');
    body.setAttribute('style',s + 'padding-top:80px !important;');
  }
})});
avatar
Valoish
Graphic Designer
Title :
Gender : Female
Age : 20
Posts : 3627
Points : 4655
Reputation : 350
Location : NYC
Language : English, Russian, Hebrew
Browser : Browser : Opera Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://www.canvasforums.com https://twitter.com/https://twitter.com/Valoishx3

PostValoish on Wed 26 Oct 2016, 15:31

For the question mark (?) to appear under the lights like they do in the screenshot, please copy the code I gave you in my previous post and paste it in your index.html file (The same file you edited earlier to get rid of the tiny, small, big, etc text).

As for centering the lights, I'm not too sure. I looked at the CSS and nothing I tried worked. I'd rather not mess with the js code since I don't have a lot of experience with it.
Maybe @Ace 1 can help. If not, Ange might know.

--------

"I was afraid. And my own insecurity crushed him." - Youku x Boku SS
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Wed 26 Oct 2016, 15:35

Thanks.
Everything works. He stayed only lights move a little to the right.



http://vracatestforum.bulgarianforum.net/forum

my js
Code:
$(function(){$(function(){
  var padTop = true,
  frame = document.createElement('IFRAME'), body = document.body, s = '';
  frame.setAttribute('style','position:absolute;left:0;right:0;top:0;width:100%;height:80px;border:none;z-index:1000;');
  frame.src = 'http://hl-club.net16.net/lights/?size=tiny';
  frame.id = 'schillmania-lights';
  body.insertBefore(frame, body.firstChild);
 
  if (document.getElementById('fa_toolbar')) {
    frame.style.top = '28px';
    document.getElementById('fa_hide').onclick = function() { frame.style.top = '0px' };
    document.getElementById('fa_show').onclick = function() { frame.style.top = '28px' }
  }
  if (padTop == true) {
    if (body.getAttribute('style')) s = body.getAttribute('style');
    body.setAttribute('style',s + 'padding-top:80px !important;');
  }
})});



my index.html
Code:
<html>
<head>
<title>Smashable Christmas Lights</title>
<link rel="stylesheet" media="screen" href="christmaslights.css" />
<script type="text/javascript" src="soundmanager2-nodebug-jsmin.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&2.6.0/build/animation/animation-min.js"></script>
<script type="text/javascript" src="christmaslights.js"></script>
<script type="text/javascript">
var urlBase = './';
soundManager.url = './';
</script>
</head>
 
<body>
 
<div>
 
 <div id="loading">
  <h1>Christmas Light Smashfest 2008: Prototype</h1>
  <h2>Rendering...</h2>
 </div>
 
 <div id="lights">
  <!-- lights go here -->
 </div>
 
<div style="position: absolute; width: auto; left: 10px; top: 55px; font-weight: bold;"><a href="javascript:window.location.reload();">?</a></div>
 
</div>
 
 
 
</body>
</html>
avatar
Ace 1
Valued Member
Title :

Beta Tester
Gender : Unspecified
Age : 17
Posts : 2122
Points : 2821
Reputation : 78
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Wed 26 Oct 2016, 19:10

Find this in the index.html

Code:
<div id="lights">
  <!-- lights go here -->
 </div>

And replace it with this:

Code:
<div id="lights" style="left: 20px; width: calc(100% - 20px);">
  <!-- lights go here -->
 </div>
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Thu 27 Oct 2016, 11:29

thank you Ace 1.

Please topic is not locked to see whether there will be problems with the code.
avatar
Ace 1
Valued Member
Title :

Beta Tester
Gender : Unspecified
Age : 17
Posts : 2122
Points : 2821
Reputation : 78
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Mon 31 Oct 2016, 08:07

@smurfavr Did it work?
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Tue 01 Nov 2016, 03:19

Everything works well. The topic does not concludes to see how it will work on smartphones.
avatar
Valoish
Graphic Designer
Title :
Gender : Female
Age : 20
Posts : 3627
Points : 4655
Reputation : 350
Location : NYC
Language : English, Russian, Hebrew
Browser : Browser : Opera Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://www.canvasforums.com https://twitter.com/https://twitter.com/Valoishx3

PostValoish on Wed 02 Nov 2016, 11:18

I just checked your forum on my Samsung Galaxy S6 (Android version 6.0.1) and it works fine for me c:

--------

"I was afraid. And my own insecurity crushed him." - Youku x Boku SS
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Thu 03 Nov 2016, 04:36

On Android 4.4.2 will not display correctly. On the right side there are no lights. What I wanted to wait to see if all users will see better lamps.

avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4675
Points : 9689
Reputation : 2331
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 03 Nov 2016, 11:55

@smurfavr the classic version doesn't appear to be optimized well for mobile.. Think

Try the following :
Go to Admin Panel > Display > Templates > General > overall_header

Find :
Code:
</head>

and replace it with this :
Code:
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
Save and publish the template.

From your screenshot the forum appears to be zoomed out. This meta tag should correct that. I'm not sure if it'll fix the lights or not though. Only one way to find out. tongue
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Thu 03 Nov 2016, 12:08

@Ange Tuteur With this code, the lights became half.
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Thu 03 Nov 2016, 12:12

avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4675
Points : 9689
Reputation : 2331
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 03 Nov 2016, 12:32

I see. Remove that for now then. I'll take a closer look in a bit. Salute
avatar
Ace 1
Valued Member
Title :

Beta Tester
Gender : Unspecified
Age : 17
Posts : 2122
Points : 2821
Reputation : 78
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Thu 03 Nov 2016, 13:02

@Ace 1 wrote:Find this in the index.html

Code:
<div id="lights">
  <!-- lights go here -->
 </div>

And replace it with this:

Code:
<div id="lights" style="left: 20px; width: calc(100% - 20px);">
  <!-- lights go here -->
 </div>

@Ange Tuteur This probably has something to do with the lights being cut in half.

For now, @smurfavr try doing what Ange told you and replacing the code I gave you with the first one you had.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4675
Points : 9689
Reputation : 2331
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 03 Nov 2016, 13:51

Ooooh I didn't notice that ! Face palm
avatar
Ace 1
Valued Member
Title :

Beta Tester
Gender : Unspecified
Age : 17
Posts : 2122
Points : 2821
Reputation : 78
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Thu 03 Nov 2016, 14:07

Yeah I tried using the calc() thing. Sometimes I forget about the mobile version Razz
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Thu 03 Nov 2016, 14:09

@Ace 1 wrote:
@Ace 1 wrote:

Code:
<div id="lights" style="left: 20px; width: calc(100% - 20px);">
  <!-- lights go here -->
 </div>

This code currently have it in index.html.
avatar
Ace 1
Valued Member
Title :

Beta Tester
Gender : Unspecified
Age : 17
Posts : 2122
Points : 2821
Reputation : 78
Location : druid hill Park
Language : Eng, Fr, Loud
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile http://fmdesign.forumotion.com/u190

PostAce 1 on Thu 03 Nov 2016, 14:13

Yes, just remove this:

Code:
 style="left: 20px; width: calc(100% - 20px);"

And try what Ange Tuteur told you.
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Thu 03 Nov 2016, 14:27

I removed it and returned to the original position.
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Sat 03 Dec 2016, 06:53

I do not know what happened, but the files are uploaded to the host from 1-2 weeks did not work.
I deleted the files and upload them again, but again do not work. What caused the problem?
avatar
smurfavr

Title :
Gender : Male
Posts : 66
Points : 838
Reputation : 0
Language : Bulgarian
Browser : Browser : Google Chrome Forum Version : Forum Version : phpBB2
Awards :
View all awards
View user profile http://smurfa.bulgarianforum.net/

Postsmurfavr on Tue 06 Dec 2016, 06:56

I wrote the host of the problem and told me the following.

I uploaded my files in, HTML file, but they no longer work. The files are Christmas lights on my website. The lights worked 10 days and then stopped and gives me the following error. http://error404.000webhost.com/cpu-limit-reached.html

What caused the problem and how to fix it?





the problem is that you "reached cpu limit"

This likely means your script has a bad loop or something that is causing it to use an unusual amount of resources, likely javacript.

review the script & follow all the loops & find the problem, you can use this script to time the processing..

put the top part at the top & the bottom part at the end of your page & change the extension to .php


Code:
<?php
// Insert this block of code at the very top of your page:
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$start = $time;



$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
printf ("Page Processed in <b> %f seconds </b>", $totaltime);
?>




I do not understand what to do.

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum