Bootstrap:主页滑块不起作用

时间:2015-11-09 08:50:15

标签: javascript jquery html css twitter-bootstrap

我正在使用BS 3.0,问题是我已经添加了脚本和滑块本身的所有代码,但它不会旋转图像。这是js文件的顺序:

private CallbackManager mFacebookCallbackManager;
private ShareDialog     mFacebookShareDialog;

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    ...

    FacebookSdk.sdkInitialize(this);
    mFacebookCallbackManager = CallbackManager.Factory.create();
    mFacebookShareDialog = new ShareDialog(this);
    mFacebookShareDialog.registerCallback(mFacebookCallbackManager, this);
}

private void shareOnFacebook()
{
    ShareLinkContent.Builder builder = new ShareLinkContent.Builder()
            .setContentTitle(mTitle)
            .setContentDescription(mContent)
            .setContentUrl(Uri.parse(mURL));

    if (!mImageURL.isEmpty())
    {
        builder.setImageUrl(Uri.parse(mImageURL));
    }

    mFacebookShareDialog.show(builder.build());
}

@Override
public void onSuccess(Sharer.Result result)
{
    String postID = result.getPostId();
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);
    mFacebookCallbackManager.onActivityResult(requestCode, resultCode, data);
}

此后还有一些。要添加图像,我有以下代码:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js"></script>
<Script src="http://alvarotrigo.com/fullPage/vendors/jquery.slimscroll.min.js"></script>

1 个答案:

答案 0 :(得分:0)

您可能忘记为Bootstrap添加触发器和CSS文件(如果没有CSS文件,它将无法工作,并且不会在控制台中出现错误)

$('.carousel').carousel({
    interval: 3000
})

这是一个工作小提琴,我添加了CSS库和jQuery代码来触发滑块:http://jsfiddle.net/43j8ebh6/1/