How to use Jquery hovercard in Socialengine 4 Fram

2019-09-20 06:38发布

问题:

I am trying to use Jquery Hovercard in Socialengine framework

I am using jquery plugin: http://designwithpc.com/Plugins/Hovercard#demo

everything works fine in my local system. but I don't know how to use the same in the socialengine framework.

can anyone help me where I can keep js file I have two js file?

  1. jquery.min.js
  2. hovercard.js

How to include and use it in Activity module exact location is bellow,

activity\views\scripts_activityText.tpl

You can also see the page here: http://demo-se.spur-i-t.com/ . I want to use under term What's new when hovering over profile image.

回答1:

First off, jQuery and Social Engine don't always play nice. SocialEngine comes with Mootools, so using it will make your life a bit easier. That said, you can add reference to your JS files into: application\modules\Core\layouts\scripts\default.tpl.

Then you will find that you have namespace conflicts between jQuery and Mootools. To resolve this you will need to change the namespace of all resulting jQuery by adding the following line at the head of the same file.

var $j = jQuery.noConflict();


回答2:

I've done this like this

<script src="<?php echo $baseURL; ?>js/jquery.js"></script>
<script type="text/javascript">

var $j = jQuery.noConflict();

$j(document).ready(function() {
  alert();
});

</script>