我正在使用kohana框架。使用jquery(kohana)的可点击的div
我试图让DIV点击可以和我不认为这将有可能与konaha做
<?php echo HTML::anchor($link .$test1->getid(). '/travel'); ?>
我想我最好的方法将是使用jQuery windown.location.href
我现在的问题是我将如何制作
<?php echo HTML::anchor($link .$test1->getid(). '/travel'); ?>
在jquery中工作?
我知道这通常
$(".grip_box").click(function() {
window.location = ""; // but this is where my problem is. as the url is different depending on the idea `$link.$test->getid`
});
我一般是新来的Kohana和MVC。
<div class="general"> //this diiv just keep things in line and make sure that the grid works in the right way.
<div class"grip_box"> --this is the div I want to make click-able
<div class"couunt"> // this just shows the number of comment and will take you the comment to save you time from scrolling
<?php echo HTML::anchor($link . $test1->getId() . '/travel#comments', count ($travelcomment)); ?>
<?php echo count($countnumber); ?>
</div>
<div class="title">
<?php echo HTML::anchor($link2 . $test1->getId() . '/view', $test1->getTitle()); ?>
</div>
</div>
<div>
什么是它的输出HTML?张贴也是。 – Jai
我对kohana不太熟悉,但是如果有一种方法可以为你的锚点设置一个id,那么可以这样做:$(“#you_anchor_id”)。click(function(){... – FabioG
@Jai –