1. Post #1681
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    My bank doesn't even use passwords. I have to use this little device which I put my debit card in and then type my PIN in. It will then give me a code I have to enter to log in.

    My other bank which is online uses a PIN like code which is 6 numbers in length and then a rememberable date.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  2. Post #1682
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    Is it wrong what I'm doing here?

    Code:
    <a onclick="changecontent(1)" href="#1">menu1</a>
    <a onclick="changecontent(2)" href="#2">menu2</a>
    <a onclick="changecontent(3)" href="#3">menu3</a>
    <a onclick="changecontent(4)" href="#4">menu4</a>
    
    <div class="content" id="content1">one</div>
    <div class="content" id="content2">two</div>
    <div class="content" id="content3">three</div>
    <div class="content" id="content4">four</div>
    Code:
    changecontent(window.location.hash.substr(1,window.location.hash.length-1));
    
    function changecontent(show){
    var showmenu = "#content"+show;
    $(".content").fadeOut(350).delay(350);
    $('html, body').animate({ scrollTop: 0 }, 'fast');
    $(showmenu).fadeIn(350);
    }
    Code:
    .content{display:none;}
    #content1{display:block;}
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  3. Post #1683
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    changecontent(window.location.hash.substr(1));
    Reply With Quote Edit / Delete Mac Australia Show Events

  4. Post #1684
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    But the way I'm showing content isn't wrong?
    Everything is in one file now and shows/hides using js when depending on what link the users clicks.

    If someone disabled js they won't get too far. Is this wrong to use this?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  5. Post #1685
    Airport Dweller
    Slater's Avatar
    October 2005
    1,197 Posts
    Well if you have addons like NoScript, which a lot of users do it's not ideal. But it's entirely down to you.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  6. Post #1686
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    You can use the hashchange event to listen for changes:

    Code:
    // check for hash changes
    $(window).bind('hashchange', function(){
    
    	// capture current location
    	var	url = document.location,
    		path = url.pathname.substr(1),
    		// remove trailing slash to prevent GA dupes
    		hash = url.hash.substr(2).replace(/\/$/, ''),
    		masterPath = path || hash,
    		// split masterpath by slashes
    		pathSegments = masterPath.split('/'),
    		// grab the first segment as page
    		page = pathSegments[0];
    
    	loadPage(page,
    		// call page specific functions
    		function(){
    		
    			switch( page ) {
    			
    				default:
    				case '':
    					loadSlider();
    					break;
    
    				case 'contactus':
    					stuff();
    					break;
    
    			}
    			
    			// hash all links in the body
    			hashLinks(body);
    		}
    	);
    })
    .trigger('hashchange');
    You can also use javascript to convert links to hash links so if JS is disabled standard links are shown.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  7. Post #1687
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    You can also use javascript to convert links to hash links so if JS is disabled standard links are shown.
    But that would still require me to put every piece of content in a different file.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  8. Post #1688
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    But that would still require me to put every piece of content in a different file.
    well, just hide the content then and display it all if JS is disabled then you can forget about the links.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  9. Post #1689
    Bus Driver
    Demache's Avatar
    December 2009
    7,881 Posts
    Here's a funny one for you. I rent my domain name from 123-reg.co.uk, and they've recently adopted a new password validation system.

    ALL passwords now HAVE to be EXACTLY 8 characters long. Why? At first thought I'd have thought it was to save on database size, but surely that'd be 8 or less characters.

    Thoughts?
    Maybe they just have a really crappy password system that can't possibly have anything but 8 characters.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 1 (list)

  10. Post #1690
    Gold Member
    toaster468's Avatar
    January 2010
    3,221 Posts
    What's a good way of validating 1 person without a password? So like there can be 1 moderator who doesn't need to login.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  11. Post #1691
    jung3o's Avatar
    October 2011
    2,076 Posts
    What's a good way of validating 1 person without a password? So like there can be 1 moderator who doesn't need to login.
    what do you mean? so by IPs? but that's not secure at all. Anyone can get on the computer with same ip and do shit.

    You can do cookies. or even make a universal password but i guess not because you said the person isn't logged in.

    Anyways why don't you login?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #1692
    Gold Member
    toaster468's Avatar
    January 2010
    3,221 Posts
    what do you mean? so by IPs? but that's not secure at all. Anyone can get on the computer with same ip and do shit.

    You can do cookies. or even make a universal password but i guess not because you said the person isn't logged in.

    Anyways why don't you login?
    I thought it would be easier for the moderator. I guess I'll have to make accounts then.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  13. Post #1693
    hzy
    Gold Member
    hzy's Avatar
    January 2009
    1,943 Posts
    have a password variable in your settings file?
    Reply With Quote Edit / Delete Mac Australia Show Events

  14. Post #1694
    Gold Member
    TheDecryptor's Avatar
    September 2006
    4,146 Posts
    Is it wrong what I'm doing here?

    Code:
    <a onclick="changecontent(1)" href="#1">menu1</a>
    <a onclick="changecontent(2)" href="#2">menu2</a>
    <a onclick="changecontent(3)" href="#3">menu3</a>
    <a onclick="changecontent(4)" href="#4">menu4</a>
    
    <div class="content" id="content1">one</div>
    <div class="content" id="content2">two</div>
    <div class="content" id="content3">three</div>
    <div class="content" id="content4">four</div>
    Code:
    changecontent(window.location.hash.substr(1,window.location.hash.length-1));
    
    function changecontent(show){
    var showmenu = "#content"+show;
    $(".content").fadeOut(350).delay(350);
    $('html, body').animate({ scrollTop: 0 }, 'fast');
    $(showmenu).fadeIn(350);
    }
    Code:
    .content{display:none;}
    #content1{display:block;}
    Instead of using a click handler on every element, you could simply attach the handler to an element higher in the DOM and work out what do based on what element received the click.

    Attaching the click handler though JS is nicer as well (Through addEventListener, "on*" method are the old pre-standard way of doing things), that way you don't have to edit the HTML if your function name/options change and there's less markup transmitted to the user.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  15. Post #1695
    Airport Dweller
    Slater's Avatar
    October 2005
    1,197 Posts
    Learning to use jQuery, and starting simple with the Nivo Slider. The pesky git won't center, despite me assigning its wrapper the following CSS statements:

    Code:
    width:960px;  
    margin:0 auto;
    Bloody annoying!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  16. Post #1696
    Gibo990's Avatar
    January 2008
    281 Posts
    I am creating an edit details form and I want it to be populated with the person who's logged in details. The form has edit boxes and i'm not sure how to fill them with the details? Would I store the details in SESSION when they first log in? e.g.

    Code:
    $_SESSION['forename'] = $row['fName'];
    $_SESSION['surname'] = $row['lName'];
    $_SESSION['email'] = $row['email'];
    But if I do that what would I call to populate the boxes? I tried value="$_SESSION['forename']" but it gives and undefined index error.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  17. Post #1697
    Airport Dweller
    Slater's Avatar
    October 2005
    1,197 Posts
    I'd use Javascript and use the innerText or innerHTML function. I can't remember the syntax of the top of my head, though.

    [SUP]Edit: [/SUP]
    You could try something along the lines of:
    document.getElementById("FORM_BOX_ID").innerHTML = YOUR $SESSION VARIABLE

    It's a stab in the dark but it's worth a try, no?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 2 (list)

  18. Post #1698
    Gibo990's Avatar
    January 2008
    281 Posts
    I'd use Javascript and use the innerText or innerHTML function. I can't remember the syntax of the top of my head, though.

    [SUP]Edit: [/SUP]
    You could try something along the lines of:
    document.getElementById("FORM_BOX_ID").innerHTML = YOUR $SESSION VARIABLE

    It's a stab in the dark but it's worth a try, no?
    Worth a try i'll have a look, cheers.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  19. Post #1699
    Airport Dweller
    Slater's Avatar
    October 2005
    1,197 Posts
    There's people here who're far more helpful than I am but I can still try. Let me know if you run into a problem.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  20. Post #1700
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    I am creating an edit details form and I want it to be populated with the person who's logged in details. The form has edit boxes and i'm not sure how to fill them with the details? Would I store the details in SESSION when they first log in? e.g.

    Code:
    $_SESSION['forename'] = $row['fName'];
    $_SESSION['surname'] = $row['lName'];
    $_SESSION['email'] = $row['email'];
    But if I do that what would I call to populate the boxes? I tried value="$_SESSION['forename']" but it gives and undefined index error.
    You need to check if it exists first..

    <input type="text" value="<?= isset($_SESSION['forename']) ? $_SESSION['forename'] : '' ?>" />
    
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 1Agree Agree x 1 (list)

  21. Post #1701
    Gibo990's Avatar
    January 2008
    281 Posts
    You need to check if it exists first..

    <input type="text" value="<?= isset($_SESSION['forename']) ? $_SESSION['forename'] : '' ?>" />
    
    That worked, thanks a lot!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  22. Post #1702
    Airport Dweller
    Slater's Avatar
    October 2005
    1,197 Posts
    Seems simpler than my idea!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 2 (list)

  23. Post #1703
    Gold Member
    toaster468's Avatar
    January 2010
    3,221 Posts
    I'm new to craftyJS and I am wondering why the twoway (event?) isn't working.

    http://www.toaster468.com/

    I've noticed that when gravity is on, I cannot move, but when gravity is off I can move just fine. Any ideas?

    EDIT:

    I found out it was a glitch on version 0.4.7 that gravity breaks other twoway, I am using 0.4.5 and it seems to be working great.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 1 (list)

  24. Post #1704
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    How to change display style of a class using javascript?

    document.getElementById("someid").style.display = 'none';

    But then with class instead of id.

    Edited:

    nevermind, figured it out.

    Code:
    	var amount = document.getElementsByClassName("someclass").length;
    	for(i=0;i < amount; i++){
    	document.getElementsByClassName("someclass").item(i).style.display = 'none';
    	}
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  25. Post #1705

    July 2011
    2,327 Posts
    Do I need complex scripts and stuff if I want pictures to expand when clicked?
    Reply With Quote Edit / Delete Windows XP Sweden Show Events Disagree Disagree x 2 (list)

  26. Post #1706
    rookwood101's Avatar
    September 2011
    252 Posts
    Do I need complex scripts and stuff if I want pictures to expand when clicked?
    Something like this? http://www.dynamicdrive.com/dynamici...agemagnify.htm
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  27. Post #1707
    Gold Member
    Dennab
    January 2012
    1,137 Posts
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 1 (list)

  28. Post #1708
    I tried to make a wordpress website into a static html
    (Using Nivo Slider)
    When I view it in my computer it works perfectly!
    But when I upload it to the webhost it's like this:

    (It stacks)
    I've tried multiple hosts. How can I fix it?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  29. Post #1709
    Gold Member
    Adzter's Avatar
    September 2009
    1,997 Posts
    I tried to make a wordpress website into a static html
    (Using Nivo Slider)
    When I view it in my computer it works perfectly!
    But when I upload it to the webhost it's like this:

    (It stacks)
    I've tried multiple hosts. How can I fix it?
    Looks like the stylesheet isn't loading, are you sure the file path is correct? I had the same issue a while back
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  30. Post #1710
    joyenusi's Avatar
    May 2006
    148 Posts
    The following page contains 3 buttons which should change the background colour when clicked.

    <!DOCTYPE html>
    <html lang="en-us">
      
    <head>
    <meta charset="utf-8">
    <title>Changing CSS Using JavaScript</title>
    <style type="text/css">
    
    body
    {
    	background-color:#FFF;
    	padding:10px;
    	color:#000;
    	font-family:Verdana, Geneva, sans-serif;
    }
    
    #wrapper
    {
    	background-color:#000;
    	width:100%;
    	height:auto;
    	float:left;
    	border-radius:15px;
    }
    
    .red_wrapper
    {
    	background-color: #333333;
    }
    
    h1
    {
    	color:#FFF;
    	background-color:#000;
    	border-radius:10px;
    	padding:1%;	
    }
    
    h2
    {
    	color:#FFF;
    	background-color:#000;
    	border-radius:10px;
    	padding:5px;
    }
    
    #content
    {
    	width:55%;
    	padding:10px;	
    	background-color:#FFF;	
    	margin:1%;	
    	border-radius:10px;
    	float:left;
    }
    
    .box
    {
    	background-color:#FFF;
    	margin:1%;
    	padding:10px;
    	float:left;
    	width:35%;
    	border-radius:15px;
    }
    
    #bRed
    {
    	background-color:#F00;
    }
    
    #bGreen
    {
    	background-color:#0F0;
    }
    
    #bBlue
    {
    	background-color:#00F;
    }
    
    </style>
    
    </head>
    
    <body>
    
    	<div id="wrapper">    	
            <div id="content">
            	<h1>Test</h1>
                <h2>Personal Profile</h2>
                <p>Test Test Test...</p>
            </div> 
            
            <div class="box">
            <h2>Contact Details</h2>
            </div> 
            <div class="box">
            <h2>Pick a color</h2>
            <button id="bRed">Red</button>
            <button id="bGreen">Green</button>
            <button id="bBlue">Blue</button>
            
            <script>
    		
    		var bRed = document.getElementById("bRed");
    		var bGreen = document.getElementById("bGreen");
    		var bBlue = document.getElementById("bBlue");
    		
    		var wrapper = document.getElementById("wrapper");
    		
    		bRed.addEventListener('click', bRedClick, false);
    		bGreen.addEventListener('click', bGreenClick, false);
    		bBlue.addEventListener('click', bBlueClick, false);
    		
    		function bRedClick(){
    			wrapper.className="red_wrapper";
    		}
    		
    		</script>
            
            </div>      
        </div>
    
    </body>
    </html>
    

    Now, why doesn't it work ?

    I've been going at this all day and could really use someone else's insight.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  31. Post #1711
    mcskinsearch
    hacksore's Avatar
    February 2010
    1,054 Posts

    Now, why doesn't it work ?

    I've been going at this all day and could really use someone else's insight.
    Since #wrapper already has background-color set you need to use !important like this:

    Code:
    .red_wrapper
    {
        background-color: #ff0000 !important;
    }
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  32. Post #1712
    joyenusi's Avatar
    May 2006
    148 Posts
    Ahh, cheers :)

    I have another quick question though, I have three buttons, one for red, one for green and one for blue, it seems adding the !important tag only allows me to change the colour once...

    Is there anyway to switch between colours ?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  33. Post #1713
    mcskinsearch
    hacksore's Avatar
    February 2010
    1,054 Posts
    Ahh, cheers :)

    I have another quick question though, I have three buttons, one for red, one for green and one for blue, it seems adding the !important tag only allows me to change the colour once...

    Is there anyway to switch between colours ?
    Have a look at this http://jsfiddle.net/vHqwY/
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #1714
    joyenusi's Avatar
    May 2006
    148 Posts
    Is the only change that all the rules have the !important tag ? because I did try that and it seemed to have no effect before...
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  35. Post #1715
    mcskinsearch
    hacksore's Avatar
    February 2010
    1,054 Posts
    Is the only change that all the rules have the !important tag ? because I did try that and it seemed to have no effect before...
    Previously you only had the red click function so I added in the missing two, a long with the corresponding style declarations.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  36. Post #1716
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts
    There is no need for !important here... just that ID takes precedence over classes, this here works:

    http://jsfiddle.net/B2wuF/1/
    Reply With Quote Edit / Delete Windows 7 France Show Events Agree Agree x 1 (list)

  37. Post #1717
    mcskinsearch
    hacksore's Avatar
    February 2010
    1,054 Posts
    There is no need for !important here... just that ID takes precedence over classes, this here works:

    http://jsfiddle.net/B2wuF/1/
    Either way works fine, but yes I do agree with the method you suggested.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  38. Post #1718
    provides mlp plot free of charge
    Oicani Gonzales's Avatar
    February 2011
    17,505 Posts
    I'm planning on making a Twitter client for Chrome, but I don't know HTML, CSS or Javascript, which makes it a big challenge.
    Since Chrome's extensions are HTML pages, basically, I'm looking into making a basic HTML twitter reader / poster and styling it with CSS to make it look like my mockup.
    Does anyone have experience with this stuff? How should I approach this?
    Reply With Quote Edit / Delete Windows 7 Brazil Show Events

  39. Post #1719
    zhed+redball.jpg
    xmariusx's Avatar
    May 2010
    1,380 Posts
    I'm planning on making a Twitter client for Chrome, but I don't know HTML, CSS or Javascript, which makes it a big challenge.
    Since Chrome's extensions are HTML pages, basically, I'm looking into making a basic HTML twitter reader / poster and styling it with CSS to make it look like my mockup.
    Does anyone have experience with this stuff? How should I approach this?
    Look for tutorials! :D
    http://www.facepunch.com/threads/1165950
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Friendly Friendly x 1 (list)

  40. Post #1720
    Gold Member
    Dennab
    January 2012
    1,137 Posts
    I'm planning on making a Twitter client for Chrome, but I don't know HTML, CSS or Javascript, which makes it a big challenge.
    Since Chrome's extensions are HTML pages, basically, I'm looking into making a basic HTML twitter reader / poster and styling it with CSS to make it look like my mockup.
    Does anyone have experience with this stuff? How should I approach this?
    The first thing you'll want to look in to is the Twitter API and Javascript, since HTML alone won't be able to dynamically grab the tweets for you. jQuery has some fantastic Ajax functions that can get you on your way
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 1 (list)