Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问回调函数LoadDPlyaer怎么使用 #36

Open
690688037 opened this issue May 13, 2022 · 6 comments
Open

请问回调函数LoadDPlyaer怎么使用 #36

690688037 opened this issue May 13, 2022 · 6 comments

Comments

@690688037
Copy link

目前使用initial主题,根本不知道要如何调用。

@690688037
Copy link
Author

我自己外部调用了 想请问你下弹幕=true怎么用 怎么放弹幕api或者文件呀

@lhuanyun
Copy link

lhuanyun commented Nov 5, 2022

loadDPlayer();
这个要写在哪里呢,我也是initial主题,开启了pjax,每次都要刷新一次页面才能显示播放器。

@langonginc
Copy link

langonginc commented Feb 6, 2023

一般主题会有一个 PJAX 回掉代码框

@langonginc
Copy link

比如我目前用的这个主题就有

image

@langonginc
Copy link

如果没有的话可以通过对主题 footer.php 进行修改。

找到如下相关内容

$(document).pjax('a[href^="SERVERNAME"]:not(a[target="_blank"], a[no-pjax], a[href^="SERVERNAME//admin"])',
		{
    		container: '#pjax-container',
    		fragment: '#pjax-container',
    		timeout: 8000
		}).on('pjax:send', function() {
			pgid = start_progress()
			$(".black-cover").fadeIn(400)
			$('html,body').animate({ scrollTop: $('html').offset().top}, 500)

						destroy()
			
		}).on('pjax:complete', function() {
			$(".black-cover").fadeOut(400)
			stop_progress(pgid)
			// 这里
                        loadDPlayer();
		})

这里 处,把 loadDPlayer(); 插入进去。

@langonginc
Copy link

langonginc commented Feb 6, 2023

initial主题的话可以在 footer.phpLine 38 Col 545 处找到相关内容。

.on('pjax:complete',function(){setTimeout(function(){$("#bar").remove()},300);$('#header').removeClass("on");$('#s').val("");<?php if ($this->options->SidebarFixed): ?>$("#secondary").removeAttr("style");<?php endif; ?>})

展开如下

.on('pjax:complete',function(){
    setTimeout(function(){
        $("#bar").remove()
    },300);
    $('#header').removeClass("on");
    $('#s').val("");
    <?php if ($this->options->SidebarFixed): ?>$("#secondary").removeAttr("style");<?php endif; ?>
    // 这里
    loadDPlayer();
})

@lhuanyun @690688037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants