ninjadude12
asked on
Fatal error: Call to a member function Animate() on a non-object in jquery.php on line 38
getting: Fatal error: Call to a member function Animate() on a non-object in jquery.php on line 38
<?php
class Jquery {
function animate($trigger, $element, $event, $time) {
echo "<script>
$(function() {
$('$trigger').$event(funct ion() {
$('#$element').slideDown($ time);
});
});
</script>";
;
}
}
?>
<?
$trigger= "a";
$element = "paragraph";
$event = "hide";
$time = "500";
$slide = new Jquery();
$slide1->animate($trigger, $element, $event, $time);
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>jquery class</title>
</head>
</html>
<?php
class Jquery {
function animate($trigger, $element, $event, $time) {
echo "<script>
$(function() {
$('$trigger').$event(funct
$('#$element').slideDown($
});
});
</script>";
;
}
}
?>
<?
$trigger= "a";
$element = "paragraph";
$event = "hide";
$time = "500";
$slide = new Jquery();
$slide1->animate($trigger,
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>jquery class</title>
</head>
</html>
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
If you add error_reporting(E_ALL) to the top of all your scripts, you will get a notice when you try to use an undefined variable. It will save you from a lot of headscratching over something as simple as a typographical error or a misspelling like this one.
The code snippet shows how to create the error and shows how different error reporting levels can give you different results. You can test it here:
http://www.laprbass.com/RAY_oop_example_2.php
Open in new window