4 Replies - 1604 Views - Last Post: 12 June 2009 - 08:22 PM

#1 kunkka  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 99
  • Joined: 15-May 09

JQuery help. the tab is not working

Posted 12 June 2009 - 02:17 AM

here is the coding

the tab's are not working. i used the jquery css and those js files

here is my code

<?php
if(!isset($_SESSION))
{
session_start();
} ?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/stylemaster.css" />
<link rel="alternate stylesheet" type="text/css" media="screen" title="secondcss" href="css/stylemaster2.css" />
<link type="text/css" href="css/jquery-ui-1.7.2.custom.css" rel="stylesheet" />	


<script src="Scripts/styleswitch.js" type="text/javascript"></script>
<script type="text/javascript" src="Scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-ui-1.7.2.custom.min.js"></script>


<script type="text/javascript">
		function createtabs()
		{
		$('#main-nav').tabs();
		
		}
</script>

<title>Online Examination</title>
</head>

<body onload="createtabs()">

 <div id="page-container"> 

 		<div id="header"><h1>&nbsp;</h1>
   </div>
		<div id="main-nav">
		
	   	<ul> <li><a href="#tab-home">Home</a></li>
		<li><a href="#tab-about">About Us</a></li>
		<li><a href="#tab-reg">Register</a></li>
	</ul>
	<p><input type="text" id="datepicker" name="datetime" /></p>
	<div id="tab-home">
	<p> home page content goes in to this tab</p>
	</div>
	<div id="tab-about">
	<p> about page content goes in to this tab</p>
	</div>
	<div id="tab-reg">
	<p> registration page content goes in to this tab</p>
	</div>
	</div>
   <div id="sidebar-a" >
   

		 <a href="java script:chooseStyle('none',60)" checked="checked">Default style</a>
		<a href="java script:chooseStyle('secondcss',60)">New Theme</a>
		
 <font class="ws8" color="#FF9900" face="Tahoma"></font>
	
	<br>Welcome <?php echo $_SESSION['Username']?>
	<p>Click here to <a href="logout.php">Logout</a></p>
	<!-- prints something like: Wednesday the 15th -->
	<br><br>
	<?php  
	echo date("l \\t\h\e jS");
	?>
	<br><br>
	<span id=tick2>
</span>

<script>
<!--

/*By Javascript Kit
http://javascriptkit.com
Credit MUST stay intact for use
*/

function show2(){
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick2"): document.all.tick2
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds+" "+dn
thelement.innerHTML="<b style='font-size:14;color:blue;'>"+ctime+"</b>"
setTimeout("show2()",1000)
}
window.onload=show2
//-->
</script>
	<br><br>
	<b>Hot Links</b><br><br>
	<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
	<td><h6><a href="class.php">Create a Class</a></h6></td>
  </tr>
  <tr>
	<td>&nbsp;</td>
  </tr>
  <tr>
	<td>&nbsp;</td>
  </tr>
</table>

	<br><br>
   
  
  
		  </div>
		<div id="content">Content   Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam gravida enim ut risus. 
	Praesent sapien purus, ultrices a, varius ac, suscipit ut, enim. Maecenas in lectus. 
	Donec in sapien in nibh rutrum gravida. Sed ut mauris. Fusce malesuada enim vitae lacus 
	euismod vulputate. Nullam rhoncus mauris ac metus. Maecenas vulputate aliquam odio. 
	Duis scelerisque justo a pede. Nam augue lorem, semper at, porta eget, placerat eget, 
	purus. Suspendisse mattis nunc vestibulum ligula. In hac habitasse platea dictumst.  <h2>About</h2>
	<p><strong>Enlighten Designs</strong> is an Internet solutions provider that specialises in 
	   front and back end development. To view some of the web sites we have created view our 
	   portfolio.</p>
	<p>We are currently undergoing a 'face lift', so if you have any questions or would 
	   like more information about the services we provide please feel free to contact us.</p>
	
	<h2>Contact Us</h2>
	<p>Phone:   (07) 853 6060<br />
	Fax:	 (07) 853 6060<br />
	Email:   <a href="mailto:info@enlighten.co.nz">info@enlighten.co.nz</a><br />
	P.O Box: 14159, Hamilton, New Zealand</p>
	<p><a href="#">More contact information...</a></p>

</div>
		<div id="footer"><div id="altnav">
		<a href="#">About</a> - 
		<a href="#">Services</a> - 
		<a href="#">Portfolio</a> - 
		<a href="#">Contact Us</a> - 
		<a href="#">Terms of Trade</a>
	</div>
	Copyright &copy; Enlighten Designs
	<br/>
	Powered by <a href="http://www.enlightenhosting.com/">Enlighten Hosting</a> and
	<a href="http://www.vadmin.co.nz/">Vadmin 3.0 CMS</a>
</div>
		
 </div>
 
</body>
</html>



Is This A Good Question/Topic? 0
  • +

Replies To: JQuery help. the tab is not working

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1002
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: JQuery help. the tab is not working

Posted 12 June 2009 - 03:32 AM

Firstly, I'd remove your onload attribute and replace your javascript with:
<script type="text/javascript">
	$(document).ready(function() {
		$('#main-nav').tabs();
	});
</script>


I don't think you're meant to have this in your tab container either:
<p><input type="text" id="datepicker" name="datetime" /></p>


Aside from that, what's the issue? The .tabs() function doesn't exist or it just does nothing?
Was This Post Helpful? 0
  • +
  • -

#3 kunkka  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 99
  • Joined: 15-May 09

Re: JQuery help. the tab is not working

Posted 12 June 2009 - 06:56 PM

i think .tab is a existing function . coz our lecturer used it. though ur solution is not working.

wow.. thanks a lot .. i made some changes.. now its working fine..
Was This Post Helpful? 0
  • +
  • -

#4 kunkka  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 99
  • Joined: 15-May 09

Re: JQuery help. the tab is not working

Posted 12 June 2009 - 07:34 PM

it works. but when i put a link to that tab. it opens the full page even with the headers and footers also .. how to avoid that
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: JQuery help. the tab is not working

Posted 12 June 2009 - 08:22 PM

Moved to JQuery :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1