Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Oct 2017
    Posts
    1
    Member #
    57540

    Signpost on the site

    Hello,


    I needed to help create a signpost on the site.
    It would be two buttons where a visitor could choose a language.
    Clicking on a button would create new buttons instead of the previous buttons that would point to that subdomain.


    Can anyone advise me or direct some guidance?
    Thank you in advance

  2.  

  3. #2
    Junior Member SoftLink's Avatar
    Join Date
    Sep 2017
    Location
    Central Florida
    Posts
    24
    Member #
    57480
    You can do that in a number of ways.
    You could just redirect them to another page.

    I'd probably use JavaScript and change the html code inside the element.
    This works.
    Code:
    <!DOCTYPE HTML>
    <html>
      <head>
      	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
        <style>	  
    	  #MyButtonContainerID {
    	  	display: inline-block;
    		float:left;
    		max-width:1200px;
    	  }
        </style>
      </head>
      <body>
        <script>
          function changeButtons(nLanguageIdx) {
    	  	
    		   var oDivButtons = $("#MyButtonContainerID");
    		   var sHTMLEnglish = "<button type='button' id='btnEnglish2' onclick='whatEver(1);' >Button 2</button>&nbsp;&nbsp;<button id='btnEnglish3' onclick='whatEver(2);'>Button 3</button>";
    		   var sHTMLFrench = "<button type='button' id='btnFrench2' onclick='whatEver(3);' >Bouton 2</button>&nbsp;&nbsp;<button id='btnFrench3' onclick='whatEver(4);'>Bouton 3</button>";
    			if(nLanguageIdx == 1) {				
    				oDivButtons.html(sHTMLEnglish);
    			} else {
    				oDivButtons.html(sHTMLFrench);
    			}
    		}
    		
    		function whatEver(nIdx)
    		{
    			alert("Button: " + nIdx);
    		}
        </script>
        
        <div class="divButtons" id="MyButtonContainerID" >
        	<button type="button" id="btnEnglish1" onclick="changeButtons(1);" >English</button>&nbsp;&nbsp;     
        	<button type="button" id="btnFrench1" onclick="changeButtons(2);" >LE franšAIS</button>
        </div>
      </body>
    </html>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:09 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com