Add fixed background music for a blog

Source: Internet
Author: User

It is actually very easy to add a background music to a blog. The key is how to make it continuous when turning pages. I just finished it. I 'd like to share some tips:

    1. Select the background music program
  • The first method is to write a player by yourself.
  • The second method is to find a webpage player provided by someone else. I choose the second, very convenient, with a fast multi-user music player: http://player.89525.com.
  • Add a player to a webpage
    • The blog park provides HTML for the header, footer, and announcement area. In these areas, we can put the player code on the webpage, which is very simple.

    However, the added player can only play on a single page, that is, it will not work after the user changes the page. How can this problem be solved? Put the player in another frame and the blog homepage in another frame using the frame web page. The Code is as follows:

    <! -- Save the following content as the default homepage file of your website/For example: index.htm, index. asp, index. php -->

    <HTML>
    <Head>
    <Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
    <Title> high-speed multi-user webpage music player (fixed frame format/bottom music player) </title>
    <Link href = "89525css.css" rel = "stylesheet" type = "text/CSS">
    </Head>
    <Frameset rows = "*, 28" frameborder = "no" border = "0" framespacing = "0">
    <Frame src = "http://player.89525.com/p/index2.php" name = "mainframe" scrolling = "yes">
    <Frame src = "http://player.89525.com/p/31/index.php? User = sys01 "name =" bottomframe "scrolling =" no "noresize>
    </Frameset>
    <Noframes>
    <Body> <p> This webpage uses a framework, but your browser does not support the framework. </P> </body>
    </Noframes>
    </Html>

    If it is your own website, it would be easy to do. If you put a homepage on your own, it will be OK. Unfortunately, this function cannot be provided in the blog Park. Of course, it is also a security consideration and cannot upload such files. Isn't it possible to use the framework?
    The method is yes. Since this framework page cannot be put on the blog garden, I can just put it on another website. For example, if I put a webpage: workshop? My method is as follows:

    <Script language = "JavaScript">
    <! --
    If (this. Name! = "Mainframe ")
    {Window. Location. href = "http://player1.89525.com/p/MusicMode.php? User = jcjks ";}
    -->
    </SCRIPT>

    The simple code is to let the blog check its name attribute. If it is "mainframe", it indicates that it has been put into the framework; otherwise, it will not, the browser will jump to the frame page with the player. The above frame page is the frame page provided by 89525. So you can.

    But now there is another question: What should I do if a user does not enter your homepage but a subpage? Because the above frame Page always redirects the page to the home page. I want to solve this problem. For example, if I write a framework page by myself and accept the parameters on the page of a user, I just need to open the mainframe sub-framework during redirection. If you don't have time to do it now, you will go home for the New Year tomorrow and try again later. There may be a simpler solution.

     

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.