- Posts: 12
COMMUNITY FORUM
use jquery on k2?
- Aristos Aristodemou
- Topic Author
- Offline
- New Member
Less
More
12 years 9 months ago #61082
by Aristos Aristodemou
use jquery on k2? was created by Aristos Aristodemou
i want to hide introtext and when i click the title to show only the current introtext.
when i click this, i want the introtext to be shown otherwise hide it
category_item.php
<?php if ($this->item->params->get('catItemTitleLinked')): ?>
<a href="<?php echo $this->item->link; ?>">
<?php echo $this->item->title; ?>
</a>
when i click this, i want the introtext to be shown otherwise hide it
category_item.php
<?php if ($this->item->params->get('catItemTitleLinked')): ?>
<a href="<?php echo $this->item->link; ?>">
<?php echo $this->item->title; ?>
</a>
Please Log in or Create an account to join the conversation.
- Andrey Miasoedov
- Offline
- Senior Member
12 years 9 months ago - 12 years 9 months ago #61083
by Andrey Miasoedov
Replied by Andrey Miasoedov on topic Re: use jquery on k2?
Hello, Aristos.
In your template's index.php, in <head> section, add the following :
<script>
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery("div.catItemIntroText").hide();
jQuery("h3.catItemTitle a").click(function() {
jQuery(this).parents("div.catItemView").find("div.catItemIntroText").slideToggle("fast");
return false;
});
});
</script>
In your template's index.php, in <head> section, add the following :
<script>
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery("div.catItemIntroText").hide();
jQuery("h3.catItemTitle a").click(function() {
jQuery(this).parents("div.catItemView").find("div.catItemIntroText").slideToggle("fast");
return false;
});
});
</script>
Please Log in or Create an account to join the conversation.
- Aristos Aristodemou
- Topic Author
- Offline
- New Member
Less
More
- Posts: 12
12 years 9 months ago #61084
by Aristos Aristodemou
Replied by Aristos Aristodemou on topic Re: use jquery on k2?
Thanks, for your help. Now i understand that anything that i want to do with jQuery to any template of k2 it should be on header section and not after in body or inside the template.
Please Log in or Create an account to join the conversation.
- Aristos Aristodemou
- Topic Author
- Offline
- New Member
Less
More
- Posts: 12
12 years 8 months ago #61085
by Aristos Aristodemou
Replied by Aristos Aristodemou on topic Re: use jquery on k2?
i have four columns of items and two rows and i want after the four items if i click their title the introtext to appear at the bottom in full width (100%) and not in 25%.
is it possible?
is it possible?
Please Log in or Create an account to join the conversation.
- Andrey Miasoedov
- Offline
- Senior Member
12 years 8 months ago #61086
by Andrey Miasoedov
Replied by Andrey Miasoedov on topic Re: use jquery on k2?
You can place a container for your introtext with 100% after columns, and get it show a intro with jQuery.
jQuery("h3.catItemTitle a").click(function() {
var intro = jQuery(this).parents("div.catItemView").find("div.catItemIntroText").html();
jQuery("div.container").html(intro);
return false;
});
replace market with your one.
jQuery("h3.catItemTitle a").click(function() {
var intro = jQuery(this).parents("div.catItemView").find("div.catItemIntroText").html();
jQuery("div.container").html(intro);
return false;
});
replace market with your one.
Please Log in or Create an account to join the conversation.
- Aristos Aristodemou
- Topic Author
- Offline
- New Member
Less
More
- Posts: 12
12 years 6 months ago #61087
by Aristos Aristodemou
Replied by Aristos Aristodemou on topic Re: use jquery on k2?
Thanks, :)
Please Log in or Create an account to join the conversation.