Author Topic: Anyone else here believe that js was made to make their life hell?  (Read 2343 times)

Online raestlyn

  • Level 29
  • **
  • Posts: 464
  • Reputation: +9/-5
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #25 on: February 12, 2010, 04:27:15 PM »
oh ok woops sorry. it's kinda early...

Code: [Select]
$(document).ready(function () {
    $('a.mainpage').click(function (e) {
        e.preventDefault();
        $('#reusepanel').load('main/tos.php #tos', function () {
            $('#reusepanel').fadeIn();
        });
    });
 });

and the part that's supposed to be working with it :/

Code: [Select]
<a href="#" class="link" id="tos"> --Terms of Use Agreement-- </a>
I've also tried to do a <a href="javascript:function(){};" class="link" id="tos"> --Terms of Use Agreement-- </a>
Lets see..
this should work:
 
Code: [Select]
$(document).ready(function () {
    $('#tos').click(function (e) {
        e.preventDefault();
        $('#reusepanel').load('main/tos.php', function () {
            $('#reusepanel').fadeIn();
        });
    });
 });
<a href="#" class="link" id="tos"> --Terms of Use Agreement-- </a>
and make sure you have something with reusepanel as a id, .load won't work without a target.


I can send you pics of my cocks if you want reference.


Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Anyone else here believe that js was made to make their life hell?
« Reply #26 on: February 12, 2010, 05:30:37 PM »
That's what I though at first, but the link he pasted is used in the load() function so and the a.mainpage probably does exist, just somewhere else

The id passed into the load() function pulls only the content of that DOM element into the #reusepanel, it doesn't set the target element that data is loaded into.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #27 on: February 13, 2010, 02:50:14 AM »
I know...I thought that's what 133794m3r was trying to do....although it's true it seems a bit weird to load just the text " --Terms of Use Agreement-- " (if it's not just shortened text)
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #28 on: February 13, 2010, 06:44:12 AM »
hmm that was the problem XD a.link was what i was supposed to use... but now the CSS isn't working...

Code: [Select]
reusepanel{
position:absolute;
z-index: 500;
border: 7px solid #FFF;
top: 200px;
left:150px;
width:650px;
height:450px;
overflow:auto;
padding:10px;
font-size: medium;
background-color: #030a0a;
color: #FFF;
}

If my understanding of CSS that should make it appear over the entire thing... but it's not for some odd reason.

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #29 on: February 13, 2010, 06:50:35 AM »
aren't you missing # ?
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #30 on: February 13, 2010, 07:10:31 AM »
my full CSS is this.

Code: [Select]
@charset "utf-8";
/* CSS Document */

body{
font-size: medium;
background-color: #030a0a;
color: #FFF;
}

a:link {
text-decoration: none;
color: #FFF}
a:visited {text-decoration: none}
a:active {text-decoration: none}
a:hover{color:#f50505;}
reusepanel{
position:absolute;
z-index: 500;
border: 7px solid #FFF;
top: 200px;
left:150px;
width:650px;
height:450px;
overflow:auto;
padding:10px;
font-size: medium;
background-color: #030a0a;
color: #FFF;
}
So no?

edit: and i'm trying to do the little hover over div thing i see so much in other sites :/ i wanted to do it to make it simpler on people, b/c after i got this one figured out, i was going to do the same with stats, and also the login page.
« Last Edit: February 13, 2010, 07:14:07 AM by 133794m3r »

Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Anyone else here believe that js was made to make their life hell?
« Reply #31 on: February 13, 2010, 09:24:43 AM »
Code: [Select]
reusepanel{

This line should be #reusepanel, as Nox pointed out.

edit: and i'm trying to do the little hover over div thing i see so much in other sites :/ i wanted to do it to make it simpler on people, b/c after i got this one figured out, i was going to do the same with stats, and also the login page.

Don't reinvent the wheel. Pick one of these: http://planetozh.com/projects/lightbox-clones/ In the upper right, check jQuery and "Can fetch content via AJAX", and never select Thickbox (it's unreliable). I just started using ColorBox last night after poking through this list for a few minutes and it's perfect for my needs, I didn't have to write any custom code at all.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #32 on: February 13, 2010, 10:40:54 AM »
Code: [Select]
reusepanel{

This line should be #reusepanel, as Nox pointed out.

edit: and i'm trying to do the little hover over div thing i see so much in other sites :/ i wanted to do it to make it simpler on people, b/c after i got this one figured out, i was going to do the same with stats, and also the login page.

Don't reinvent the wheel. Pick one of these: http://planetozh.com/projects/lightbox-clones/ In the upper right, check jQuery and "Can fetch content via AJAX", and never select Thickbox (it's unreliable). I just started using ColorBox last night after poking through this list for a few minutes and it's perfect for my needs, I didn't have to write any custom code at all.

ah ok whenever i did a mainpage thing it didn't make me do a "#" :P and wow, didn't know so many... had done that... feel kinda dumb now... oh well i settled on the first one that had alot of features XD

Offline Fizzadar

  • Level 8
  • *
  • Posts: 39
  • Reputation: +0/-0
  • Rawr!
    • View Profile
    • Fanatical Dev
Re: Anyone else here believe that js was made to make their life hell?
« Reply #33 on: March 02, 2010, 03:33:03 PM »
I love javascript, don't like many of the libraries though.

In my current game-in-development, I've written an entire javascript engine from scratch, I love it.
~Fizzadar

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal