2

Been at this for over an hour now - lightbox plugin was working just fine (as expected) but for whatever reason I cannot get this fancybox plugin to work properly.

The setup:

For testing purposes I am using the images from fancy box's website - absolute path reference -, the jQuery declaration from their site, and the css file they recommend I use.

The error:

Uncaught TypeError: Object # has no method 'undelegate'

To see the error:

  1. Go to The Error Page and inspect element in chrome
  2. Feel free to view the source of my website, I'm almost positive I've referenced everything correctly

I appreciate any help, thank you.


set start time and end time php mysql

So I am currently working for Online Election system for my school project and I am having a hard time how to set a start and end time for election. I have a date/time picker for start time and for end time and then I want the value of dtpicker to save in my database and I want to have a countdown based on the time on my database and if the election start it will display the voting page and if the election ends it will redirect to results. How can I do that. I've been a lot of threads but they did not solve my problem. Could you please help me? Do you have any idea or suggest a website related to my problem? I'm stuck on this problem for 3 days. Any help would be greatly appreciated.

---UPDATE---

so here is my code below:

 <?php
 $con = mysql_connect("localhost","root","vertrigo");
 if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }

 mysql_select_db("db_voting", $con);

 $result = mysql_query("SELECT * FROM time WHERE time_ID = 1");

 $numrow = mysql_num_rows($result);

 if ($numrow == 0)
 {
die('No election found.');
 }

 $row = mysql_fetch_row($result);
 $startdate = date_format(date_create($row[1]), 'm/d/Y H:i:s');
 echo "Voting will start: " . $startdate. "<br />";

 $closedate = date_format(date_create($row[2]), 'm/d/Y H:i:s');
 echo "Voting will end: " . $closedate;
 ?>
<p>Time Left:
<script language="JavaScript">
TargetDate = "<?php echo $closedate ?>";
BackColor = "palegreen";
ForeColor = "navy";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "Voting has Ended";
</script>
<script language="JavaScript" src="countdown.js"></script>

so what i am trying to do is whenever the election ends it will redirect to result if not then it will display the voting page. should I use if else statement? I am so sorry, I am still a noob about this. Could you please help me out.?

4

1 回答 1

3

嗨,您使用的是旧版本的 jQuery,即 1.4.1。

.undelegate() 方法是在 jQuery 版本 1.4.2 中添加的。将 jQuery 版本更改为 1.4.2 或最新版本,fancybox 可以正常工作

参考:Jquery .undelegate()

于 2012-08-26T14:14:31.703 回答